The small program toFixed (tofixed) detailed introduction, the small program toFixed
The applet retains decimal places (toFixed)
I have encountered many problems today, but the problem is small.The applet retains decimal places (toFixed)Knowledge:
1. Retain the digits after the decimal point.
The method is very simple. toFixed (). The number in the brackets indicates the number of reserved digits. If it is an integer, it will not be 0
Special note: The returned result is a String. I didn't know it at first. I used the return value for addition. After half an hour, I had to spell the String and asked Huang xiujie about the error. the value is obtained only when the parseInt () type is used.
2. Get the number of digits toPrecision ()
The first group gets four digits, and the second group gets six digits.
Thank you for reading this article. I hope it will help you. Thank you for your support for this site!