0

I'm trying to round the value pulled from an API, without expressing it using e.

At the moment I'm getting the value 6.65e+7. I want the value to be 66,500,000.

Here's the code I'm using at the moment:

   function precise(x) {
   return Number.parseFloat(x).toPrecision(3);
   }
                  
   $('#population').html(precise(result['data']['geonames'][0]['population']).toString());

0 Answers0