Fix infinite loop in getPrecision() function

This commit is contained in:
silverpill 2022-09-28 21:40:28 +00:00
parent 0604e61561
commit 403174fe60

View file

@ -13,6 +13,9 @@ export function roundBigNumber(value: BigNumber, precision: number): BigNumber {
} }
function getPrecision(value: number): number { function getPrecision(value: number): number {
if (typeof value !== "number") {
return 0
}
if (!isFinite(value)) { if (!isFinite(value)) {
return 0 return 0
} }