tags:

views:

100

answers:

3

Hi, do you know how can i put a dot (.) after 3 digits of a number(starting from the end) in php? example: the number 1254631 to be shown as 1.254.631??

+2  A: 

Use the number_format function

Marek Karbarz
+2  A: 

You are looking for number_format.

Pekka
+7  A: 

if you want to pretty print a number, number_format is nice

echo number_format(1254631 , 0, ',', '.');  // prints 1.254.631

the last argument is the thousands separator (dot in your case)

jspcal