Rounds

Syntax

round($value)

round(value: $value, digits: $digits)

Description

Rounds the floating point number value to the given number of digits.

Parameters

Name Type Description Mandatory Default
value Number A floating point number for rounding. yes
digits Number Specifies the number of digits after the decimal point. no 0 (no decimal places)

Return value

Type: Number

The rounded number with digits decimal places. An integer if digits = 0.

Examples

Round

round(3.141)

Output: 3

Round

round(8.5)

Output: 8

Round up

round(8.502)

Output: 9

Specification of digits

round(4.1234, 2)

Output: 4.12

More digits than places

round(4.12, 5)

Output: 4.12