Re: Re: PHP Equivalent of JavaScript whatever.toFixed(2)
| From: | Jochem Maas | Date: | Tue, 09 Sep 2008 16:20:09 +0000 |
| Subject: | Re: Re: PHP Equivalent of JavaScript whatever.toFixed(2) | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279736@lists.php.net to get a copy of this message | ||
Nathan Rixham schreef:
Jochem Maas wrote:what about round(), what's the problem?Ross McKay schreef:maybe I'm reading this wrong but http://uk2.php.net/manual/en/function.round.phpArnie Shore wrote:watch out with number_format() it will format according to the current locale unless you specify the decimal and thousands seperator char explicitly ... e.g. english: 1,000.00 dutch: 1.000,00On Mon, 08 Sep 2008 22:03:54 +0200, Sjoerd wrote:Folks, I need to take a given float value to, say, two decimals, as per subject JS. I've RTFM, but to no avail.$str = sprintf("%01.2f", $number);Skinning cat, method two: $str = number_format($number, 2);