Skip to content

Commit

Permalink
fix: example for unscale to base
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmnthn committed Mar 24, 2024
1 parent 7bd1f85 commit 06a694a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/utils/src/units/unscale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export function unScale(value: bigint | string, decimals: number) {
/**
* unScale the given base number to base(bigint) unscale to the given decimals and drop the remaining decimals
* @example
* unScaleToBase(69000000000000000000n, 12) // 69000000n
* unScaleToBase(69n, 0) // 69n
* unScaleToBase(69000000000000000000n, 18, 6) // 69000000n
* unScaleToBase(69n, 0, 0) // 69n
*/
export function unScaleToBase(value: bigint | string, decimals: number, newDecimals: number) {
if (decimals < newDecimals)
Expand Down

0 comments on commit 06a694a

Please sign in to comment.