@0xtorch/big-decimal
Version:
An arbitrary precision Decimal type for TypeScript that extends BigInt.
17 lines • 526 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeTrailingZeros = void 0;
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,
};
};
exports.removeTrailingZeros = removeTrailingZeros;
//# sourceMappingURL=removeTrailingZeros.js.map