Introduction: This is the PHP Number_format () function of the detailed page, introduced and php,php, number, format, round PHP Number_format () function related knowledge, skills, experience, and some PHP source code and so on.
class= ' pingjiaf ' frameborder= ' 0 ' src= ' http://biancheng.dnbcw.info/pingjia.php?id=351508 ' scrolling= ' no ' > formatted numbers Functions Number_format and Round
The Number_format () function formats numbers by using thousands of groupings.
Syntax: Number_format (number,decimals,decimalpoint,separator)
Parameter description
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.
Hints and Notes
Note: The function supports one, two, or four parameters (not three).
The round () function rounds a floating-point number.
Syntax: Round (X,PREC)
Parameter description
X is optional. Specifies the number to round.
Prec is optional. Specifies the number of digits after the decimal point.
Description: Returns the result of rounding x according to the specified precision Prec (number of digits after decimal point). Prec can also be negative or 0 (the default value).
Note: PHP does not correctly handle strings that resemble "12,300.2" by default.
Love EE focus on Java Michael Jackson Video station JSON online tool
Http://biancheng.dnbcw.info/php/351508.html Pageno:3