Skip to content

Commit

Permalink
fix: Fix layerzero number format issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Halibao-Lala committed Dec 20, 2024
1 parent 1963496 commit 745c29c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/canonical-bridge-widget/src/core/utils/number.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export const formatNumber = (value: number, decimals = 18) => {
export const formatNumber = (value: number, decimals = 18, useGrouping = true) => {
const num = removeAfterDecimals(value, decimals);
return num.toLocaleString('fullwide', {
maximumFractionDigits: decimals,
useGrouping,
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const useGetLayerZeroFees = () => {
];
const nativeFee = fees[0];
const minAmount = parseUnits(
String(formatNumber(Number(sendValue), 8)),
String(formatNumber(Number(sendValue), 8, false)),
selectedToken?.layerZero?.raw?.decimals ?? (18 as number),
);
const cakeArgs = {
Expand Down

0 comments on commit 745c29c

Please sign in to comment.