Data conversion and formatting functions
Some data type conversions are handled in the normal process flow by NAV without any particular attention on part of the Developer; for example, Code to Text, Char to Text, and so on. Some data type conversions can only be handled through C/AL functions. Formatting is included because it can also include a data type conversion. Rounding does not perform a data type conversion but does result in a change in format (the number of decimal places). These C/AL functions are:
ROUND
FORMAT
EVALUATE
ROUND
The ROUND
function 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 what is being rounded, Precision
spells out the number of digits of decimal precision, and Direction
indicates whether to round up, round down, or round to the nearest number. The following table shows some examples of Precision
values:
Precision value... |
---|