Skip to content

Commit

Permalink
Fix: Prevented transforming to incorrect amount with >=22 digits
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew718PLTS committed Jan 13, 2025
1 parent 48bd4f5 commit 6605ed3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/amount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function toWei(
decimals = STANDARD_TOKEN_DECIMALS
): BigNumber {
if (!value) return new BigNumber(0)
const valueString = value.toString().trim()
const valueString = new BigNumber(value).toFixed().trim()
const components = valueString.split('.')
if (components.length === 1) {
return new BigNumber(parseUnits(valueString, decimals).toString())
Expand Down

0 comments on commit 6605ed3

Please sign in to comment.