Fixed Point Intrinsic Functions - Round Method

Round the number to the nearest n decimal places

Member of Fixed Point Intrinsic Functions (PRIM_LIBI.IFixedPointIntrinsics)

Parameters

NameTypeData TypeDescription
Result*Result (Optional)DecimalResulting number
Operation*Input (Optional)EnumerationType of rounding to be performed
Decimals*Input (Optional)IntegerNumber of decimal places

Details

Round allows a number to be rounded to a specified number of decimal places using a selected rounding technique.
 
The default is to round HalfUp

Allowed Operations

Enum ValueDescription
DownAlways round down
UpAlways round up
HalfDownRound down if the rounding value is 5 or less
HalfUpRound up if the rounding value is 5 or more

Example

Rounding up 10.51 to 1 decimal place will produce a result of 10.6.
 
Rounding up 10.01 to 0 decimal place will produce a result of 11.0.
 
Rounding down 10.51 to 1 decimal place will produce a result of 10.5.
 
Rounding up 10.99 to 0 decimal place will produce a result of 11.0.
 
Rounding halfup 10.49 to 1 decimal place will produce a result of 10.5.
 
Rounding halfup 10.44 to 1 decimal place will produce a result of 10.4.
 
Rounding halfdown 10.44 to 1 decimal place will produce a result of 10.4.
 
Rounding halfdown 10.46 to 1 decimal place will produce a result of 10.5.
#Result := #Number.Round(Up 1)

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2