NumericRound

Rounds the target variable to the number of decimal places specified.

Syntax

bool NumericRound (String Target, String DecimalPlaces)

Parameters

Target: A smart parameter specifying the location of the variable whose value will be rounded.

DecimalPlaces: A positive integer indicating the number of decimal places to keep after rounding. A value of 0 will result in an integer value. If no parameter is provided or if the provided value is not an integer, 0 will be used as the default. Smart parameters are supported.

Returns

False if the specified target is not a valid number, if the target is invalid or if error occurs. Otherwise, True.

Level

All.

Details

Obtains the value from the target specified and rounds it to the number of decimal spaces specified. This action respects the current locale. The numbers specified as the amount must match the specification for the current locale. For example, if the current locale is "en-US", then the decimal separator must be a period ".". If the current locale is "fr-FR", then the decimal separator must be a comma ",".

Example 1
NumericRound("@X","2")

Assuming this is called on a field object, it will round the numeric value of the field to two decimal places. If the field text value is "123.456", the value will be changed to "123.46".

Example 2
NumericRound("@B.MyVar","")

Regardless of the DCO object attached to this action, it will round the batch level variable "MyVar" to 0 decimal places. If the variable contained the value "123.456", the new value would be "123".