Use the Number_format () function in PHP to format numbers using thousands of groupings.
Number_format (Number,decimals,decimalpoint,separator)
Number required. The number to format. If no other parameters are set, the number is formatted with no decimal point and comma (,) as the delimiter.
Decimals is optional. How many decimal places are specified. If this parameter is set, the number is formatted with a dot (.) as the decimal point.
Decimalpoint is optional. Specifies a string to use as a decimal point.
Separator is optional. Specifies the string to use as the thousand separator. Only the first character of the parameter is used. For example, "XYZ" only outputs "X".
※ Note: If this parameter is set, all other parameters are required.
$number = 1234.56;
English notation (default)
Number_format ($number);//1,235
French notation
Number_format ($number, 2, ', ', ');//1 234,56 a space between the last single quotation mark
$number = 1234.5678;
English notation, with no thousand-points
Number_format ($number, 2, '. ', ');//1234.57
The most commonly used notation in Chinese, the thousand bits are ', ', floating-point separated as '. ', reserved two-bit floating-point number
Number_format ($number, 2, '. ', ', ');//1,234.57
The above describes the PHP data with thousands of separators separated display, including the aspects of the content, I hope to be interested in PHP tutorial friends helpful.