RE: [PHP] money print out with two digits after , e.g. 49,00
| From: | Johnson, Kirk | Date: | Tue, 08 May 2001 15:04:50 +0000 |
| Subject: | RE: [PHP] money print out with two digits after , e.g. 49,00 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-51908@lists.php.net to get a copy of this message | ||
Try number_format() http://www.php.net/manual/en/function.number-format.php
Kirk
> -----Original Message-----
> From: Ramiro Radjiman [mailto:php@rrwebdesign.nl]
> Sent: Tuesday, May 08, 2001 8:35 AM
> To: php-general@lists.php.net
> Subject: [PHP] money print out with two digits after , e.g. 49,00
>
>
> I want to changes 49.4 ---> 49,4
> 49,4 ----> 49,40
>
> the first rule is done with the code
>
> $totaal=49.4;
> $totaal=str_replace(".",",",$totaal);
>
> how can i do the second row??