Home >Web Front-end >JS Tutorial >JS retains two decimal places and a small example of rounding function_javascript skills

JS retains two decimal places and a small example of rounding function_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:13:381280browse

js rounding function toFixed(), the parameter inside is the number of decimal places to retain.

Copy code The code is as follows: