We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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))
then i need to get the floor of this number as a bigint, to pass to viem, so i do
const bigIntValue = n[0] / 10n ** BigInt(n[1])
it would be useful if there was perhaps an api like.
toBigInt(n:Numberish): bigint // usage: const bigIntValue = dnum.toBigInt(n)
would you be open to a PR with something like this? or is there an existing function that i can use to do the same task?
dnum.from(n, 0)[0] maybe? (it seems sort of cursed)
dnum.from(n, 0)[0]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
i use dnum to go from token amount in decimals -> absolute token amount.
this is usually done by doing something like
then i need to get the floor of this number as a bigint, to pass to viem, so i do
it would be useful if there was perhaps an api like.
would you be open to a PR with something like this? or is there an existing function that i can use to do the same task?
dnum.from(n, 0)[0]
maybe? (it seems sort of cursed)The text was updated successfully, but these errors were encountered: