On Fri, 27 Aug 2004 14:06:56 +0530, Ma SivaKumar <[EMAIL PROTECTED]> wrote:
> A copy of php manual I downloaded a year back
> has the following about the behaviour of
> number_format function
> 
> <?php
> $number = 1234.56;
> // english notation (default)
> $english_format_number =
> number_format($number);
> // 1,234.56
> ?>
> 
> The latest on-line version is changed as
> below
> <?php
> $number = 1234.56;
> // english notation (default)
> $english_format_number =
> number_format($number);

number_format($number, 2);

> // 1,234
> 
> In many un-updated sites I could see the old
> version. I am not successful finding the
> change log related to this.
> 
> Does any one know why it is changed thus?
> 
> 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.
> 
> I am looking at sprintf now.
> 
> Thanks and Best regards,
> 
> Ma SivaKumar
> 


-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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

Reply via email to