Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rounding off, but always having two digits

Status
Not open for further replies.

photoxprt1868

Programmer
Jul 22, 2005
76
US
Hello,

How can I round using Math.round but making sure to always have two digits. In other words 45.20 vs 45.2

this is how I have it now

var difference = Math.round((fuel2006 - fuel2005)*100)/100;

but I'm looking the last digit if it's 0. I need that 0 there.

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top