I am getting numbers back from postgre db in float format and when trying to print them in my html page they took too much space. How do I cut the excessive precision number using a quick JS function? i.e:
98.7776 --> 98.7
var num = 98.7776;
var result = num.toFixed(1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With