expression / expression
DISPLAY "INVENTORY COMMITMENTS AS A PERCENT OF UNITS ON HAND".FOR EACH Item NO-LOCK:DISPLAY Item.ItemNum Item.ItemName Item.Allocated Item.OnHand(Item.Allocated / Item.OnHand) * 100 FORMAT ">>9" LABEL "PCT".END.
ABL always performs division as a decimal operation (the product of 5 / 2 is 2.5, not 2). If you assign the result to an integer field, ABL rounds the decimal to make the assignment. When you want ABL to truncate a quotient to an integer, use the TRUNCATE function (TRUNCATE(5 / 2, 0) is 2).
The result of dividing a number by 0 is the Unknown value (?), and the AVM does not display an error message.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |