Skip to content

Commit

Permalink
Merge pull request #14 from terraswap/fix/exponential
Browse files Browse the repository at this point in the history
fix: exponential value
  • Loading branch information
JoowonYun authored Jun 25, 2024
2 parents c793285 + eaf95b8 commit a1e247b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libs/math.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import BN from "bignumber.js"
import BN, { BigNumber } from "bignumber.js"
import { isNil } from "ramda"

BigNumber.config({ EXPONENTIAL_AT: 18 })

export const plus = (a?: BN.Value, b?: BN.Value): string =>
new BN(a || 0).plus(b || 0).toString()

Expand Down Expand Up @@ -28,7 +30,7 @@ export const ceil = (n: BN.Value): string =>
export const floor = (n: BN.Value): string =>
new BN(n).integerValue(BN.ROUND_FLOOR).toString()

export const halfUp = (n: BN.Value): string =>
export const halfUp = (n: BN.Value): string =>
new BN(n).integerValue(BN.ROUND_HALF_UP).toString()

export const abs = (n: BN.Value): string => new BN(n).abs().toString()
Expand Down

0 comments on commit a1e247b

Please sign in to comment.