I'm working on a NodeJs script that handles strings with exponential values.
Something like this:
1.070000000000000e+003
Which is the best way to convert (or parse) this string and obtain a floating value?
Thanks for the help.
I'm working on a NodeJs script that handles strings with exponential values.
Something like this:
1.070000000000000e+003
Which is the best way to convert (or parse) this string and obtain a floating value?
Thanks for the help.
Copyright © 2021 Jogjafile Inc.
You may convert by using
parseFloat
orNumber
If you prefer to parse, maybe the best way is by a regular expression:
as suggested here and convert the single capturing group.