ethers-maths
Version:
➗ Useful ethers-based math libraries to ease the journey through off-chain fixed-point arithmetics
5 lines (4 loc) • 314 B
TypeScript
import { BigNumberish } from "ethers";
export declare const format: (x: BigNumberish, decimals?: number, digits?: number) => string;
export declare const toFloat: (x: BigNumberish, decimals?: number) => number;
export declare const toDecimals: (x: BigNumberish, decimals: number, scaleDecimals: number) => bigint;