Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 800 Bytes

Math.ROUND.md

File metadata and controls

32 lines (26 loc) · 800 Bytes

Math.ROUND

The ROUND function is established to round a number just like the same name excel function.

Sample

Math.ROUND(5.5,0);		//6
Math.ROUND(2.5,0);		//3
Math.ROUND(1.6,0);		//2
Math.ROUND(1.1,0);		//1
Math.ROUND(1.0,0);		//1
Math.ROUND(-1.0,0);		//-1
Math.ROUND(-1.1,0);		//-1
Math.ROUND(-1.6,0);		//-2
Math.ROUND(-2.5,0);		//-3
Math.ROUND(-5.5,0);		//-6

Math.ROUND(1.2345,3);		//1.235

API

CallingReturning
Math.ROUND ( num, digit )Number
ParametersTypeDescription
numNumberThe number to round.
digitNumberNumber of digits after the decimal point.