How to convert 1e+30
to 1000000000000000000000000000000
I want number as it is entered by User do not convert like 1e+30
.
How can achieve this? Is there any way to display actual digits after parse it to float or int?
The core library doesn't give you any support for numbers that don't fit into the native number
type, so you'll probably want to use a third party library to help you with large decimals.
For example, https://mikemcl.github.io/decimal.js/
new Decimal('1e+30').toFixed()
// "1000000000000000000000000000000"
You may use toLocaleString
(1000000000000000000000000000000).toLocaleString("en-US", { useGrouping: false })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With