Math decimals

Round off decimals: Math.floor(2)=2
Round off decimals: Math.floor(2.1)=2
Round off decimals: Math.floor(-2.1)=-3
Round off decimals: Math.floor(-2.5)= -3 Round off
decimal: Math.floor(-2.9)=-3
Round off: Math.rint(2)=2
Round off: Math.rint(2.1)=2
Round off: Math.rint(-2.5)=-2
Round off: Math.rint(2.5)=2
Round off: Math.rint(2.9)=3
Round off: Math.rint(-2.9)= -3
rounding: Math.rint(-2.49)=-2
rounding: Math.rint(-2.51)=-3
rounding: Math.ceil(2)=2
rounding: Math.ceil(2.1) =3
rounding up: Math.ceil(2.5)=3
rounding up: Math.ceil(2.9)=3
Rounding off decimals: Math.floor(-2)=-2
Rounding off decimals: Math.floor( -2.1)=-3 Round off
decimals: Math.floor(-2.5)=-3 Round off
decimals: Math.floor(-2.9)=-3
Round up: Math.ceil(-2)=- 2
凑整:Math.ceil(-2.1)=-2
凑整:Math.ceil(-2.5)=-2
凑整:Math.ceil(-2.9)=-2
Math.round(3.14)3
Math.round(3.5)4
Math.round(-3.14)-3
Math.round(-3.5)-3

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325751411&siteId=291194637