|
The FRAC_DIGITS Function
This function is also related to the format of variable. It returns the maximum number of digits in the fraction part of the variable. In other words, it gives the level of precision that is used to output variables of that format.
The returned value does not depend at all on the variable value. It is derived directly from the variable format (which is fixed for the duration of the run).
The FRAC_DIGITS function in GPP2 comes to substitute a similar capability that was part of the old GPP CONVERT statement that is not supported in GPP2.
The following examples assume VAR has a format with maximum 2 decimal digits for the fraction part.
VAR = 2.9999; Set internal value to 2.9999
N = FRAC_DIGITS(VAR); N gets 2
VAR = 3;
N = FRAC_DIGITS(VAR); N stays 2 (not dependent on VAR's value)
|