On Fri, 27 Aug 2004 14:06:56 +0530, Ma SivaKumar <[EMAIL PROTECTED]> wrote:
> 
> The latest on-line version is changed as
> below
> <?php
> $number = 1234.56;
> // english notation (default)
> $english_format_number =
> number_format($number);
> // 1,234
> 
> What is the best way to format numbers to put
> only the thousand separator without removing
> or adding decimal places to the number.
> 
> For example,
> 
> 1000 should return 1,000
> 1000.5 should return 1,000.5
> 1000.25 should return 1,000.25
> so on.
> 
> 
> Ma SivaKumar

Thus says http://www.php.net/number_format

string number_format ( float number [, int decimals])
string number_format ( float number, int decimals, string dec_point,
string thousands_sep)
.
.
.
If two parameters are given, number will be formatted with decimals
decimals with a dot (".") in front, and a comma (",") between every
group of thousands.


----

ramil

http://ramil.sagum.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to