11 - 347 11 - 347
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
Format character
Function
Example
“.”
• A decimal point is inserted. A decimal point can be
inserted at any place in the format.
• If a format string is placed following a decimal point,
the corresponding digits are always displayed.
• 0 is displayed for redundant digits in the decimal
part.
• If the number of decimal places in the format string
is smaller than the number of digits in the decimal
part of a numeric value, the numeric value is
rounded to the specified digit and displayed.
• If the number of digits of a numeric value exceeds
the number of digits in the format as a result of
rounding up the numeric value, % is displayed
before the rounded numeric value.
PRINT USING “ ##.##” ;.78
0.78
OK
PRINT USING “ ##.##” ;78
78.00
OK
PRINT USING “ ##.##” ;78.125
78.13
OK
PRINT USING “ .##” ;.999
%1.00
OK
“+”
If this character is specified at the beginning or end of
the format string, the sign (+ or -) of the value is
displayed before or after a numeric value,
respectively.
PRINT USING “ +##.#” ;–68.9
–68.9
OK
PRINTUSING “ +##.#” ;24
+24.0
OK
PRINT USING “ ##.#+ ;–55
55.0–
OK
“-”
If this character is specified at the end of the format
string, a negative sign (-) is displayed after a negative
numeric value.
PRINT USING “ ##.#-“ ;–70.1
70.1–
OK
“**”
If these characters are specified at the beginning of
the format string, * is displayed at leading spaces of a
numeric value. ** reserves an area for two digits, in
the same way as “##.”
PRINT USING “ **#.#” ;12.39
*12.4
OK
PRINT USING “ **#.#” ;765.1
765.1
OK
“\\”
• If this character is specified at the beginning of the
format string, \ is displayed immediately to the left
of a formatted numeric value. \\ reserves an area
for two digits, but only the space for one digit
among them is used for \.
• It is not allowed to specify \\ for a numeric value in
exponential format.
PRINT USING “ \\###.#” ;456.7
\456.7
OK
“**\”
• If these characters are specified at the beginning of
the format string, * is displayed at the leading part
and \ is displayed immediately before the number.
• **\ reserves an area for three digits, but only one
digit among them is used for \.
PRINT USING “ **\##.##” ;2.34
***\2.34
OK
(Continued on the next page)
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...