PDA

View Full Version : Decimal Discrepancy?



ArchBytes
20 Mar 2010, 3:58 AM
Hey so I had a textfields that get numbers and then subtract them to one another. I use the parseFloat() method but there's something weird that happens I get extra decimal values?

Example: 45790.3 - 45700 = 90.30000000000291

both digits are inputted so it doesn't go through database formatting at all.. is there anyway around this?

Thanks!

fay
20 Mar 2010, 4:21 AM
toFixed() (http://www.w3schools.com/jsref/jsref_tofixed.asp)?