I had to deal with this problem recently -- I don't usually do math with JS ( not usually beyond ++ and -- anyway ) ... I wound up doing this:
Math.round(myvar*100)/100 To get the correct value to 2 decimal places... Isaac Dealey www.turnkey.to 954-776-0046 > Know what's wierd? All these calculations work perfectly in vbscript. > Arggg. Luckily, we al have IE here, so bwahahaha! > ----- Original Message ----- > From: Brian Eckerman <[EMAIL PROTECTED]> > Date: Monday, July 1, 2002 11:49 am > Subject: RE: *CRITCAL FLAW* >> no i'm trying to take 12.1+.1+.1+.1 and it comes out to >> 12.40000000001 >> >> ARRRGGGGGHHHHHH this is cripling >> >> -----Original Message----- >> From: Critter [mailto:[EMAIL PROTECTED]] >> Sent: Monday, July 01, 2002 1:18 PM >> To: CF-Talk >> Subject: Re: *CRITCAL FLAW* >> >> >> oi Brian!! >> >> are you using parseFloat() ? >> >> >> -- >> Critz >> Certified Adv. ColdFusion Developer >> >> Crit[s2k] - <CF_ChannelOP Network="Efnet" Channel="ColdFusion"> >> ------------------------------------ >> Monday, July 1, 2002, 1:11:59 PM, you wrote: >> >> BE> I know this is WAY of track, but what the heck is up with >> BE> the way Javascript messes up floating point numbers. >> >> BE> Sheesh. >> BE> >> >> > ______________________________________________________________________ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

