Javascript--toFixed () function

Source: Internet
Author: User

Javascript--tofiexed () function

1. toFixed (n) limit the number of digits after the decimal point, rounded. N:0~20.

2. The Action object must be number and cannot be a different type. such as (8.001). toFixed (2) returns 8.00;

3. ToFixed (n) the return value is of type string, and it is wrong to make the size as a number.

4. Parsefloat ("number") and parseint ("numbers") read the first encounter in the string (for example, 91.2w3 the first number is 91.2) and convert to a float or int, the return type is #.

Reference Address: http://www.cnblogs.com/nkxyf/p/3956653.html

Javascript--toFixed () function

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.