SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: Help me with coma seperators
-
May 1, 2006, 23:34 #1
- Join Date
- Feb 2006
- Posts
- 299
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Help me with coma seperators
Coma separators
I am asking for help. How can I make financial or cash figures have coma separators in php programming using mysql as database. For example if I have one million and fifty cents dollars. I want numbers to appear as $1,000,000.50. So how do I ensure that comas separators are coming automatically.
-
May 2, 2006, 00:24 #2
- Join Date
- Mar 2006
- Posts
- 6,132
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
number_format() works nice
-
May 2, 2006, 01:38 #3
- Join Date
- Feb 2006
- Posts
- 299
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
clamcrusher, what do you mean by saying number_format() works nice??
explain to me who it is done??
-
May 2, 2006, 01:40 #4
- Join Date
- Aug 2003
- Location
- Manchester, UK
- Posts
- 4,007
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
number_format has a number of examples. Also see the user comments for more.
-
May 2, 2006, 01:41 #5
- Join Date
- Oct 2002
- Location
- Scotland
- Posts
- 3,631
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
PHP Code:$number = 1000000.5;
$format = number_format ($number,2);
echo $number." becomes ".$format;
Bookmarks