UNPKG

@0xtorch/big-decimal

Version:

An arbitrary precision Decimal type for TypeScript that extends BigInt.

13 lines 367 B
export const removeTrailingZeros = ({ value, decimals, }) => { let mut_value = value; let mut_decimals = decimals; while (mut_value % 10n === 0n && mut_decimals > 0) { mut_value /= 10n; mut_decimals -= 1; } return { value: mut_value, decimals: mut_decimals, }; }; //# sourceMappingURL=removeTrailingZeros.js.map