From 6e8b7dcd32ad429602f34339fe8d8ea37a369000 Mon Sep 17 00:00:00 2001 From: MarkusGarmeister Date: Thu, 19 Dec 2024 13:03:07 +0100 Subject: [PATCH] fixed displayed fees for polar path --- components/Switch.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/Switch.tsx b/components/Switch.tsx index 658d0dc..aab605f 100644 --- a/components/Switch.tsx +++ b/components/Switch.tsx @@ -202,7 +202,13 @@ export const SwitchComponent: FC = () => { const transactionFee = await transaction.paymentInfo(sourceAccount); setTransaction(transaction); - setFeeDisplay(transactionFee.partialFee.toHuman()); + const rawFee = transactionFee.partialFee.toHuman().replace(/,/g, ""); + const transferFeeFormatted = formatBalance({ + number: BigInt(rawFee), + decimals: 15, + displayDecimals: 15, + }); + setFeeDisplay(transferFeeFormatted); } catch (err) { console.error(err); setError({ @@ -537,7 +543,7 @@ export const SwitchComponent: FC = () => {
- Transfer Fee: {feeDisplay} + Transfer Fee: {feeDisplay} {tokenSymbol ?? ""}
{sourceId === "assethub" ? null : ( <>