0

    var i = 0.0000000015220700152207;
    var num = document.getElementById('number');
    
    function start() {
      setInterval(increase, 1000);
    }
    
    function increase() {
        if (i < 0.0048) {
         i+= 0.0000000000000000000001;
         var decimal =parseFloat(i);
          num.innerText = decimal;
        }
    }   
<body onload="setTimeout(start,5000) ; setTimeout(end,3000) ">
    <div id="number">0.0000000015220700152207</div>
</body>

this function returns number in scientific notation "1.5220700153457109e-9" i want to convert it to decimal type. but nothings finds to b fruitfull. plz suggest me some thing which guides me to the right. i will be thankful to you

Nicolas
  • 8,077
  • 4
  • 21
  • 51
user
  • 15
  • 6
  • 1
    There's only one kind of number in JavaScript (well, two if you include big integers in newer environments). There's no reason to use `parseFloat()` on a value that's already a number. – Pointy Dec 06 '19 at 16:01
  • Posible solution [here](https://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript) – FF- Dec 06 '19 at 16:04
  • i dnt understand yet. how can i prevent my number from scientific notation – user Dec 06 '19 at 16:12

0 Answers0