1

I'm rounding up a positive number to the nearest thousand like if you type 10 it should return 1000, working fine until you type a big number like 1000000000000000000000 the result is this 1e+21, how can I avoid this and just let it show all the numbers? the code I'm using is this

value = Math.ceil(value/1000)*1000;
 $(element).val(value);

Thank you

Gustavo Sanchez
  • 725
  • 2
  • 6
  • 14
  • Have a look here : http://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript - Damn you @AlexK. ;) – somethinghere Nov 05 '14 at 13:42
  • Have a look at [Opposite of Number.toExponential in JS](http://stackoverflow.com/questions/4170633/opposite-of-number-toexponential-in-js) – chead23 Nov 05 '14 at 13:42

0 Answers0