Reference > Methods
round(value)
Definition
Long round(Number value)
Description
Returns the closest Long value given the supplied value. Equivalent to roundDown(value+.5).
Parameter Definition
Name |
Type |
Description |
value |
Number |
Value to round |
Examples
| Long r1 = round(32.5D); // r1 == 33
Long r2 = round(-32.5D); // r2 == -32
Long r3 = round(32.2D); // r3 == 32
Long r4 = round(-32.2D); // r4 == -32
Long r5 = round(32.8D); // r5 == 33
Long r6 = round(-32.8D); // r6 == -33
Long r7 = round(14); // r7 == 14
Long r8 = round(-14); // r8 == -14
|