Re: [PHP] [PHP-DB] Displaying Floats

2002-03-29 Thread Bogdan Stancescu
As replied above, or echo(round($money*100)/100); Just to point out another way - the previous suggestions are better because they most probably involve way less math on the server. Bogdan Ian Wayne wrote: >Hi all. > >I can't believe I'm stuck on this - seems to me there ought to be an easy

Re: [PHP] [PHP-DB] Displaying Floats

2002-03-29 Thread Rasmus Lerdorf
A couple of ways. The most flexible is probably to use number_format() since that lets you set the separators as well. printf("%.2f",$value) would also do it. -Rasmus On Fri, 29 Mar 2002, Ian Wayne wrote: > Hi all. > > I can't believe I'm stuck on this - seems to me there ought to be an easy

Re: [PHP] [PHP-DB] Displaying Floats

2002-03-29 Thread Miguel Cruz
On Fri, 29 Mar 2002, Ian Wayne wrote: > I have a table of accounts and I want to display all the money amounts > to 2 decimal places. How do I do this? Should I use floatval (which I > can't use because it's CVS only)? Or is there some other way? http://php.net/printf miguel -- PHP General

[PHP] [PHP-DB] Displaying Floats

2002-03-29 Thread Ian Wayne
Hi all. I can't believe I'm stuck on this - seems to me there ought to be an easy way to do this, but I've been hunting through the literature and I just can't find it. If anyone can point me in the right direction it'd be much appreciated... I have a table of accounts and I want to display all