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.
Example
An external application regularly updates the prices of items in a product catalog. 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 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)}%>
CODE
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. |