I have a string of value
1.02947826525E9
and it has exponential component. I want to convert this string to corresponding numeric value.
Is there a direct way to convert this string to numeric value?
I have a string of value
1.02947826525E9
and it has exponential component. I want to convert this string to corresponding numeric value.
Is there a direct way to convert this string to numeric value?
Using parseFloat()
:
console.log(parseFloat('1.02947826525E9'))
USING Number()
console.log(Number('1.02947826525E9'));
USING Explicit type conversion
console.log('1.02947826525E9' * 1);