0

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?

2 Answers2

3

Use the built-in parseFloat.

parseFloat('1.02947826525E9')
Sami Hult
  • 2,968
  • 1
  • 10
  • 16
2

Using parseFloat():

console.log(parseFloat('1.02947826525E9'))

USING Number()

console.log(Number('1.02947826525E9'));

USING Explicit type conversion

console.log('1.02947826525E9' * 1);
Ankit Agarwal
  • 29,658
  • 5
  • 35
  • 59