10 14 8 Round

LANSA Technical

10.14.8 Round

Round allows a number to be rounded to a specified number of decimal places using a selected rounding technique.

Input Parameters

Operation - Type of rounding to be performed

Allowable values are

Up - will always round up

Down - will always round down

Halfup - will round up if the rounding value is 5 or more

Halfdown - will round up if the rounding value is 5 or less

See the Examples for more information on the behavior of each rounding type

Decimals - Number of decimal places to round to

Example

#Result := #Number.Round(Up 1)

 

Rounding up 10.51 to 1 decimal places will produce a result of 10.6.

Rounding up 10.01 to 0 decimal places will produce a result of 11.0.

Rounding down 10.51 to 1 decimal places will produce a result of 10.5.

Rounding up 10.99 to 0 decimal places will produce a result of 11.0.

 

Rounding halfup 10.49 to 1 decimal places will produce a result of 10.5.

Rounding halfup 10.44 to 1 decimal places will produce a result of 10.4.

Rounding halfdown 10.44 to 1 decimal places will produce a result of 10.4.

Rounding halfdown 10.46 to 1 decimal places will produce a result of 10.5.

Ý 10.14 Fixed Point Intrinsic Functions