dnum
dnum copied to clipboard
🧮 Small library for big decimal numbers.
Nice library. We'd like to do a PR to add following functionality to better display token dust. E.g. when amounts are < 0.0 ``` dnum.format([ 126, 8], roundDust: 1) =>...
## Description Currently, `dnum` does not support exponential notation (e.g., `1e18`), which is commonly used in Web3 for token balances and financial calculations. This makes it difficult to work with...
i use dnum to go from token amount in decimals -> absolute token amount. this is usually done by doing something like ``` const n = dnum.multiply(dnum.from(decimalAmount), 10n ** BigInt(decimals))...
Related to #11. This PR fixes the CJS build process, fixing issues with environments (_ahem_, jest) that struggle with ESM imports. For more info on `@tanstack/config`, see [docs.](https://tanstack.com/config/latest/docs/overview)
### Overview This PR adds support for parsing formatted number strings with thousands separators directly into the `from()` function. This creates a complete round-trip workflow where `format()` can produce formatted...