3. Instructions
508
CS/CJ/NSJ Series Instructions Reference Manual (W474)
• Limits on the Number of Digits in the Integer Part
1) Decimal Notation (C = 0 hex)
• When there is no fractional part (C+2 = 0 hex):
1 ≤ Number of Integer Digits ≤ 24
• When there is a fractional part (C+2 = 1 to 7 hex):
1 ≤ Number of Integer Digits ≤ (24 - Fractional digits - 2)
2) Scientific Notation (C = 1 hex)
1 digit (fixed)
• Limits on the Number of Digits in the Fractional Part
1) Decimal Notation (C = 0 hex)
• Fractional Digits ≤ 7
• Also: Fractional Digits ≤ (Total Number of ASCII Characters - 3)
2) Scientific Notation (C =1 hex)
• Fractional Digits ≤ 7
• Also: Fractional Digits ≤ (Total Number of ASCII Characters - 7)
Example Programming
z Converting to ASCII Text in Decimal Notation
When CIO 0.00 is ON in the following example, FSTR(448) converts the floating-point data in D1 and
D0 to decimal-notation ASCII text and writes the ASCII text to the destination words beginning with
D100. The contents of the control words (D10 to D12) specify the details on the data format (decimal
notation, 7 characters total, 3 fractional digits).
2E (.)
32 (2)
00
1010100001110010
0011111010100111
FSTR
D0
D10
D100
0.00
15 0
D0
D1
0(Hex)
7(Hex)
3(Hex)
D10
D11
D12
0.327457
30 (0)
33 (3)
37 (7)
D100
D101
D102
D103
0.327457
20 (Space)20 (Space)
Decimal notation
Total characters = 7 characters
Fractional digits = 3 digits (characters)
Conversion
Rounded off
Storage
conditions
Spaces
Total number of characters
Fractional part