Re: Re: Is there such a thing as number_format() in JavaScript (Instead of PHP)???

From: Date: Tue, 16 Sep 2003 17:25:29 +0000
Subject: Re: Re: Is there such a thing as number_format() in JavaScript (Instead of PHP)???
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-162768@lists.php.net to get a copy of this message
Well, I use IE and Mozilla. This one work only with one decimal point. "Marek Kilimajer" <kilimajer@webglobe.sk> wrote in message news:3F673BE9.3000809@webglobe.sk... > It did? I tried it once and javascript came up with the same result. > What browsers did you try? I ended up implementing javascript version of > number_format(). > > Scott Fletcher wrote: > > > Ah! Never mind. I only need to do this... > > > > AmtRequestBy = Math.round(AmtRequestBy*100)/100; > > > > That is multiplying by 100 and dividing by 100 and that will fix it. > > > > Sorry for hte Spam > > Scott F. > > > > "Scott Fletcher" <scott@abcoa.com> wrote in message > > news:20030916162640.27987.qmail@pb1.pair.com... > > > >>Hi Fellas! > >> > >> Javascript is driving me crazy. I'm not looking forward to writing a > >>user-defined function that would do something to the numbers as > >>number_format would do. > >> > >> > >> When I do something like (1.00 + 2.34), I would expect a 3.34 in > > > > return, > > > >>not a 3.34900388389495. > >> > >>Thanks, > >> Scott > > > >

« previous php.general (#162768) next »