0

i have this html

<p class="res_current tooltip" name="2.969.226.853.669.634.301.755.392" id="current_metal">3 Q</p>

im using this code to get the number of name:

var a = document.getElementById('current_metal').name;

i need to use a to compare like

if(a < 10) { do something }

but the problem is that when i see a (using alert) it return something like this

-> 2,96922685366e+24

so i cant do the if :(, there is a way to get the FULL number without the "."? or convert it

user2582318
  • 1,607
  • 5
  • 29
  • 47
  • Have you tried this asked question here: https://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript – nima Jun 02 '18 at 14:31

1 Answers1

0

Use parseInt:

parseInt(a, 10);

CAUTION: Do not omit the radix argument!

Community
  • 1
  • 1
Hushme
  • 3,108
  • 1
  • 20
  • 26