Data conversion and formatting methods
Some data-type conversions are handled in the normal process flow by AL without any particular attention on the part of the developer, such as code to text and character to text. Some data-type conversions can only be handled through AL methods. Formatting is included because it can also include a data type conversion. Rounding does not do a data type conversion, but it does result in a change in format (the number of decimal places). Let’s review the following methods:
Round
methodFormat
methodEvaluate
method
Round method
The Round
method allows us to control the rounding precision for a decimal expression. The syntax for the Round
function is as follows:
DecimalResult := Round(Number[, Precision][, Direction]);
Here, Number
is rounded, Precision
spells out the number of digits of decimal precision, and Direction
indicates whether to round up, down, or to the nearest number. Some examples of Precision
values...