Forum Moderators: coopster

Message Too Old, No Replies

A point per thousand in a number

         

turbohost

7:59 am on Feb 20, 2005 (gmt 0)

10+ Year Member



Hi Guys,

How can I write 1000 as 1.000 (and 1000000 as 1.000.000) in PHP?

Thx,
Turbo

dmorison

8:05 am on Feb 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



number_format() [uk.php.net]

(not sure if it can do dots instead of commas; but if it can't just use str_replace to change the commas to dots afterwards)

hakre

6:22 pm on Feb 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



string number_format ( float number [, int decimals [, string dec_point, string thousands_sep]] )

==>> no need to replace afterwards, just use the 2nd and 3rd parameter to set the seperator for thousands and the decimal point.

turbohost

10:40 pm on Feb 21, 2005 (gmt 0)

10+ Year Member



ok, it works. Thx guys