From 3d92791a8274729ebc29b95b1ff89e3794b87d8f Mon Sep 17 00:00:00 2001 From: Dillon Lin <30581721+DillonLin@users.noreply.github.com> Date: Thu, 25 May 2023 17:13:43 +1000 Subject: [PATCH] fix: toBigNumber --- app/src/utils/toBigNumber.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/utils/toBigNumber.ts b/app/src/utils/toBigNumber.ts index b0e81d72..5be36fbb 100644 --- a/app/src/utils/toBigNumber.ts +++ b/app/src/utils/toBigNumber.ts @@ -2,6 +2,5 @@ import { BigNumber } from '@ethersproject/bignumber' import { parseUnits } from '@ethersproject/units' export default function toBigNumber(number: number, decimals: number = 18): BigNumber { - const numberStr = number.toString().includes('e') ? number.toFixed(decimals).toString() : number.toString() - return parseUnits(numberStr, decimals) + return parseUnits(number.toFixed(decimals).toString(), decimals) }