Help
-
Search
-
Members
-
Calendar
Full Version:
Getting Php To Format Numbers
Zymic Webmaster Forums
>
Web Design & Development
>
Server Side Scripting
>
PHP
aircombat
Feb 10 2008, 11:12 AM
I want PHP to automatically format numbers with comma.
Example 1000000 should be automatically formatted to 1,000,000.
Pls guide me how to do so.
Tom
Feb 10 2008, 11:14 AM
http://php.net/number_format/
aircombat
Feb 13 2008, 08:54 AM
Ok I got it to format numbers, but it is not multiplying formatted numbers. I am getting 337,000*1 = 337
Any solutions ?
Trice
Feb 13 2008, 10:15 AM
Do the calculations before you format the number?
For example
CODE
$number1 = 6;
$number2 = 100000;
$number3 = $number1*$number2;
$english_format_number = number_format($number3);
?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here
.
Invision Power Board © 2001-2010
Invision Power Services, Inc.