TRUNCATE ( expression , decimal-places )A non-negative integer expression that indicates the number of decimal places for a truncated expression.This procedure doubles each Customer’s CreditLimit and then truncates that value before rounding it to the nearest $1000:
FOR EACH Customer:FORM Customer.CustNum Customer.Name Customer.CreditLimitnew-max LIKE Customer.CreditLimit LABEL "New Credit limit".DISPLAY Customer.CustNum Customer.Name Customer.CreditLimit.Customer.CreditLimit =TRUNCATE((Customer.CreditLimit * 2) / 1000 ,0) * 1000.IF Customer.CreditLimit < 15000 THENCustomer.CreditLimit = 15000.DISPLAY Customer.CreditLimit @ new-max.END.You can use the TRUNCATE function to treat division as integer division. For example, i = TRUNCATE (x / y, 0).
© 2012 Progress Software Corporation and/or its subsidiaries or affiliates. |