Re: PHP Equivalent of JavaScript whatever.toFixed(2)

From: Date: Tue, 09 Sep 2008 00:43:22 +0000
Subject: Re: PHP Equivalent of JavaScript whatever.toFixed(2)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-279707@lists.php.net to get a copy of this message
Arnie Shore 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. On Mon, 08 Sep 2008 22:03:54 +0200, Sjoerd wrote: >$str = sprintf("%01.2f", $number); Skinning cat, method two: $str = number_format($number, 2); -- Ross McKay, Toronto, NSW Australia "Let the laddie play wi the knife - he'll learn" - The Wee Book of Calvin

« previous php.general (#279707) next »