Rounding and truncating numbers

Several functions contain a parameter that determines to what level the function rounds or truncates the value it returns.

This parameter accepts an integer that is either greater than 0, 0, or less than 0. The following table explains how numbers are rounded and truncated in these cases:
Parameter Description
> 0

The function rounds/truncates to <parameter> decimal places.

Examples:

Round(3.13;1) returns 3.1

Round(3.157;2) returns 3.16

0

The function rounds/truncates to the nearest integer.

Examples:

Truncate(3.7;0) returns 3

Truncate(4.164;0) returns 4

< 0

The function rounds/truncates to the nearest 10 (parameter = -1), 100 (parameter = -2), 1000 (parameter = -3) and so on.

Examples:

Round(123.76;-1) returns 120

Round(459.9;-2) returns 500

Truncate(1600;-3) returns 1000

Note Numbers are represented internally using double-precision floating-point formats and have 15 to 17 digits of precision.