round Function |
Top Previous Next |
Rounds a number to the nearest integer. SyntaxMath.round(number) Arguments
Return ValueA number which represents the nearest integer of the argument. RemarksIf the first digit after the comma is a number lower than 5, the number is rounded down, otherwise, the number is rounded up. ExamplesMath.round(0.1); // Returns 0 Math.round(-0.1); // Returns 0 Math.round(8.47); // Returns 8 Math.round(8.57); // Returns 9 |