Re: [PHP] money print out with two digits after , e.g. 49,00
Tuesday, May 08, 2001, 10:34:51 AM, Ramiro Radjiman wrote: RR I want to changes 49.4 --- 49,4 RR 49,4 49,40 RR the first rule is done with the code RR $totaal=49.4; RR $totaal=str_replace(.,,,$totaal); RR how can i do the second row?? RR please help. RR greets Ramiro Check out number_format() which should allow you to do what you need. http://www.php.net/manual/en/function.number-format.php If not, you could always format: 49.4 - 49.40 - str_replace() - 49,40 -- Good Luck, -Neill [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] money print out with two digits after , e.g. 49,00
Try number_format() http://www.php.net/manual/en/function.number-format.php Kirk -Original Message- From: Ramiro Radjiman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 08, 2001 8:35 AM To: [EMAIL PROTECTED] 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?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] money print out with two digits after , e.g. 49,00
At 08.05.01 16:34, you wrote: I want to changes 49.4 --- 49,4 49,4 49,40 Try this ? $totaal=49.4; $totaal=str_replace(.,,,sprintf(%2.2f,$totaal)); echo TOTAL after =$totaalbr; ? Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]