Page 1 of 1

i want my number to appear 1,234,567.89

Posted: Wed Oct 28, 2009 1:56 pm
by adsegzy
Hello there,

Please i to display the amount in my database to appear in currency unit. for example if what i have in my database is 123456789, i want to echo it as 1,234,567.89 that is full-stop after the first two figures and comma after every 3 characters

Regards
Olusegun

Re: i want my number to appear 1,234,567.89

Posted: Wed Oct 28, 2009 2:22 pm
by ipconfig
I think this is what you're looking for:

http://php.net/manual/en/function.number-format.php

So, for example:

Code: Select all

$number = 123456789;
echo number_format($number, 2, '.', ',');