jquery rounding decimals treatment summary

A, jQuery in decimal rounding, the rounding method

1. discarding the fractional part, the integer part reserved

parseInt(5/2) =2

2. rounding.

Math.round(5/2) =3

3. rounded down

Math.floor(5/2) =2

Math object's methods

Guess you like

Origin www.cnblogs.com/newcapecjmc/p/11994213.html