round
round(x)
round(x, n)
round(unit, valuelessUnit)
round(unit, n, valuelessUnit)
round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.
Try it yourself:
$1 | round(3.2)
| |
$2 | round(3.8)
| |
$3 | round(-4.2)
| |
$4 | round(-4.8)
| |
$5 | round(pi, 3)
| |
$6 | round(123.45678, 2)
| |
$7 | round(3.241cm, 2, cm)
| |
$8 | round([3.2, 3.8, -4.7])
|