From 44d22c4a4df23d871cbf65697c13d437e6861b17 Mon Sep 17 00:00:00 2001 From: shoom3301 Date: Mon, 16 Oct 2023 18:39:38 +0600 Subject: [PATCH] fix(swap): don't crash app when token decimals eq 0 --- apps/cowswap-frontend/src/modules/swap/pure/warnings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/cowswap-frontend/src/modules/swap/pure/warnings.tsx b/apps/cowswap-frontend/src/modules/swap/pure/warnings.tsx index f7720bd985..3682af3634 100644 --- a/apps/cowswap-frontend/src/modules/swap/pure/warnings.tsx +++ b/apps/cowswap-frontend/src/modules/swap/pure/warnings.tsx @@ -101,7 +101,7 @@ export const SwapWarningsTop = React.memo(function (props: SwapWarningsTopProps) priceImpact={priceImpact} buyingFiatAmount={buyingFiatAmount} tradeUrlParams={tradeUrlParams} - sellAmount={trade?.inputAmount.toFixed(trade?.inputAmount?.currency?.decimals || 18)} + sellAmount={trade?.inputAmount.toExact()} /> )