How to display the result of “toPrecision” without the scientific notation?

To get a float with reduced precision, you could use toPrecision() like you do, and then parse the scientific notation with parseFloat(), like so:

result = parseFloat(num.toPrecision(2));

If you do not wish to reduce precision, you could use toFixed() to get the number with a certain number of decimals.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)