PHP Number_format () function

Source: Internet
Author: User
Tags php source code
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
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.