To display numbers to end users, especially large numbers, you may need to format them to be more user friendly. For example, with a large integer 43386000.75, it is usually preferred to comma-separate every 3 digits to this:
To format numbers this way in PHP, you need number_format() function:
print number_format(43386000.75); // prints '43,386,000.75'
This is English notation of numbers with thousands separator. For French number notation:
print number_format(43386000, 2, ',', ' '); // prints '43 386 000,75'
Deducing from the parameters used in the above example, we have the number_format() function synopsis:
string number_format ( float $number , int $decimals , string $dec_point , string $thousands_sep )
With number_format(), you can format any integer number of floating point number by thousands separator (which in most cases is a comma), decimal point (which usually is a period point), number of decimal digits after the decimal point.