standard.C.math.number_format

number_format is available since version 1.0.

Prototype:

string number_format(number number, number decimals, string dec_point, string thousands_sep)

Parameters

number
the number to format
decimals
the number of decimals
dec_point
the decimal point character to use
thousands_sep
the thousands separator

Description:

Format number with decimals decimals, dec_point instead of a dot before the decimals and thousands_sep instead of a comma (",") between every group of thousands.

Return value:

Returns the formatted versuib of the number as a string.

Example
var number=1234.5678;
echo number_format(number, 2, '.', ','); // 1,234.57