I had a javascript calculation that was displaying a ton of decimal points.
Here is a way to round to 2 decimal places in Javascript:
var total = 123.433
total = Math.round(total*100)/100 //returns 123.43
Credit Goes to Javascript ToolKit
My name is Randy Johnson. I use Lucee, Coldfusion, PHP, jQuery, Javascript & MySQL on a daily basis. When called upon I will flex my Linux and Windows server administration & server migrations but prefer to be programming web applications.
I had a javascript calculation that was displaying a ton of decimal points.
Here is a way to round to 2 decimal places in Javascript:
var total = 123.433
total = Math.round(total*100)/100 //returns 123.43
Credit Goes to Javascript ToolKit
Comments
Post a Comment