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?

HareshKannan
  • 83
  • 11

2 Answers2

3

Use the built-in parseFloat.

parseFloat('1.02947826525E9')
Sami Hult
  • 3,052
  • 1
  • 12
  • 17
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
  • 30,378
  • 5
  • 37
  • 62