Skip to content

Commit f4ae9d6

Browse files
authored
fix: round number before floor (#2174)
1 parent b2ed793 commit f4ae9d6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/wallet/frontend/src/utils/helpers.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export const formatAmount = (args: FormatAmountArgs): FormattedAmount => {
4444

4545
const scaledValue = Number(`${value}e-${assetScale}`)
4646
const flooredValue =
47-
Math.floor(scaledValue * 10 ** displayScale) / 10 ** displayScale
47+
Math.floor(Math.round(scaledValue * 10 ** displayScale)) /
48+
10 ** displayScale
4849

4950
const symbol = getCurrencySymbol(assetCode)
5051

0 commit comments

Comments
 (0)