Exponential Notation

Format

QR [ n { E | . } m ] [ edit ] [ mask ] 
QL [ n { E | . } m ] [ edit ] [ mask ] 
QX

The Q code converts numeric input data from exponential notation to a format appropriate for internal storage. When converting internal representation of data to external output format, the Q code converts the data to exponential notation by determining how many places to the right of the decimal point are to be displayed and by specifying the exponent.

Q alone and QR both specify right justification. QL specifies left justification. QX specifies right justification. QX is synonymous with QR0E0 as input and MR as output.

n specifies the number of fractional digits to the right of the decimal point. It can be a number from 0 through 9.

m specifies the exponent. It can be a number from 0 through 9. When used with E, m can also be a negative number from -1 through -9.

Separate n and m with either the letter E or a period ( . ). Use E if you want to specify a negative exponent.

edit can be any of the following:

$
Prefixes a dollar sign to the value.
F
Prefixes a franc sign to the value.
,
Inserts commas after every thousand.
Z
Returns an empty string if the value is 0. Any trailing fractional zeros are suppressed, and a zero exponent is suppressed.
E
Surrounds negative numbers with angle brackets (< >).
C
Appends cr to negative numbers.
D
Appends db to positive numbers.
B
Appends db to negative numbers.
N
Suppresses a minus sign on negative numbers.
M
Appends a minus sign to negative numbers.
T
Truncates instead of rounding.

mask allows literals to be intermixed with numerics in the formatted output field. The mask can include any combination of literals and the following three special format mask characters:

#n
Data is displayed in a field of n fill characters. A blank is the default fill character. It is used if the format string does not specify a fill character after the width parameter.
%n
Data is displayed in a field of n zeros.
*n
Data is displayed in a field of n asterisks.

If NLS is enabled, the Q code formats numeric and monetary values as the ML and MR codes do, except that the intl format cannot be specified. See the ML and MR codes for more information.

See the FMT function for more information about formatting numbers.