In reply to "adrian at zhp dot inet dot pl" digit grouping function:
<?php
$number = strrev(chunk_split (strrev($number), 3,' '));
//If $number is '1234567', result is '1 234 567'.
?>
There is a much more simple way of doing this, by using the built-in number_format() function.
<?php
$number = number_format($number,2,"."," ");
//This will round $number to 2 decimals, use the dot (".")
//as decimal point, and the space (" ") as thousand sepparator.
?>