Syntax

	round($number)

round($number, $digits)

Description

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

Parameters

Name Type Description Mandatory Default
number 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 up

	round(8.5)

Output: 9

Specification of digits

	round(4.1234, 2)

Output: 4.12

More digits than places

	round(4.12, 5)

Output: 4.12