form( Real, RealFormat ) form( Single, SciFormat ) form( Double, SciFormat ) form( Single, HexSciFormat ) form( Double, HexSciFormat )
RealFormat := EqualSpace DecimalNumber EqualSpace
EqualSpace := {('=' Printable Repeat)* | (' ' Repeat)}*
IF abs(Real) > .00009 AND -99999.99999 <= Real <= 99999.99999 THEN Form = "MD#.ZN4" ELSE Form = "MZ.Z5eMD#"
Floating point numbers may be displayed as decimal or hexadecimal values. If a Fraction field is given, a mantissa is optional
SciFormat := EqualSpace SciMantissa '.' [Fraction] Exponent EqualSpace
Exponent := {'E' | 'e'} Sign {'N' | 'n'}* {'D' | 'd'}* ['#']
EqualSpace := {('=' Printable Repeat)* | (' ' Repeat)}*
Printable := ' ' to '~'
Repeat := ['1' to '9' ['0' to '9']]
SciMantissa := Sign NullUnder DecimalUnder
Sign := ['M' | 'm' | 'S' | 's']
NullUnder := (Null '_'*)*
DecimalUnder := (Decimal '_'*)* Decimal
HexSciFormat := EqualSpace Sign HexReal HexExponent EqualSpace
Sign := ['M' | 'm' | 'S' | 's']
EqualSpace := {('=' Printable Repeat)* | (' ' Repeat)}*
Printable := ' ' to '~'
Repeat := ['1' to '9' ['0' to '9']]
HexReal := ['#'] '1.' HexRadix ['#']
HexRadix := Hex ('_'* Hex)*
Hex := {'H' | 'h'} Repeat
HexExponent := {'P' | 'p'} Sign Hex+ ['#']
Hexadecimal floating point numbers are written using scientific notation. The mantissa has an optional sign, an optional literal, and "1." followed by a hexadecimal fractional part. The exponent field is reqired and is two raised to the power of a signed hexadecimal integer.
Number of hex digits with embedded underscores
'H' ==> upper case 'A' to 'F' digits
'h' ==> lower case 'a' to 'f' digits
two digit size ==> number of digits to return
'#' after leading ==> return only as many digits as needed
Note 1: The Space, Underscore, and Comma will only appear if preceded
by a numeral.
Note 2: If anything that is not a letter or number appears in the
template the entire template must be surrounded by quotes.
Note 3: The asterisk may not appear to the left of the decimal point
for any reason whatsoever. It also must not appear to the
right of a fixed position special character.
Leading characters may appear to the left of the radiax.
Repetition of a Leading character in the template requires that
the result must also be a character that is permitted by the next
character to the right.
Z Includes zeros in the result.
The result will not be a blank.
N Makes the leading spaces null if ocupied by zeros
else it makes them a digit.
S and M may only appear as Leading characters in Decimal format only.
S Either + or - in the result.
+ will appear in the result if Expression >= 0;
- will appear in the result if Expression < 0.
M Either a blank or - in the result.
- will appear in the result if Expression < 0;
a blank, null, or digit will appear in the result if
Expression >= 0 (which one depends on the default)
Expressions of integer types will be evaluated as signed
integers when either S or M is specified.
Trailing characters may appear to the right of the radiax.
Z As a Trailing character, Z forces 0 after the result by rounding.
Trailing Zs repeated signifies rounding to the last digit.