Re: How do I get the result of a Division to 2 decimal places?
| From: | Marek Kilimajer | Date: | Tue, 09 Sep 2003 15:10:21 +0000 |
| Subject: | Re: How do I get the result of a Division to 2 decimal places? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-162072@lists.php.net to get a copy of this message | ||
I meant you cannot set decimal point to be '', it will always display. Yes you can supply '' for the third argument.
Jay Blanchard wrote:
[snip] It is not mentioned in the manual, but it seems dec_point cannot be empty. If it is empty, default (.) is taken. .... echo number_format($number, 4, '', ',')."\n"; number_format() does allow an empty set of single quotes in the third attribute which it will default to a period (.) for the decimal point. number_format() does require that have all the attributes stated, or it will throw an error. So if you do this.... echo number_format($number, 4, ',')."\n"; You should get an error.