SET_SCALE

Description

Rounds a number to the specified number of decimal places using half-even rounding.

Syntax

SET_SCALE(num, num_digits) -> Decimal

Parameters

ParameterData TypeRequiredDescription
numNumberYesA numeric literal, field, or expression to format.
num_digitsIntegerYesThe number of digits to keep after the decimal point.

Examples

SET_SCALE(12.345, 2)
-- Returns 12.34.
SET_SCALE(-2.25, 1)
-- Returns -2.2.