Try OpenEdge Now
skip to main content
ABL Reference
ABL Syntax Reference : ROUND function
 

ROUND function

Rounds a decimal expression to a specified number of places after the decimal point.

Syntax

ROUND ( expression , precision )
expression
A decimal expression.
precision
A non-negative integer expression whose value is the number of places you want in the decimal result of the ROUND function.

Example

This procedure increases all CreditLimit values by 10 percent, rounding those values to the nearest $100:
r-round.p
FOR EACH Customer:
  DISPLAY Customer.CustNum Customer.Name Customer.CreditLimit.
  Customer.CreditLimit = ROUND((Customer.CreditLimit * 1.1) / 100 ,0) * 100.
  PAUSE.
  DISPLAY Customer.CreditLimit.
END.

See also

TRUNCATE function