The function ecm:round rounds the target number up to a value determined by the specified number of fractional digits. The value returned is an integer data type.

Structure​

ecm:round(number, integer)

Parameters​

Parameter

Description

number

Specifies the target value to be rounded.

integer

Specifies the number of fractional digits to be included in the result.

Example

An external application regularly updates the prices of items in a product catalogue. The application calculates currency conversions to values with four decimal places. These values are imported into an unlinked related data set named ​Products​.

Prices from this data set are inserted into in a message, rounding the number to two decimal places. The expression is constructed as follows:

<%${ecm:round((ecx:related('Products',user.CustomAttribute['ProductID_2'])['Price'],2)}%>