Commands and functions
P.
223 of 349
String format
Definition
●
Function
stringformat
(
data, conversion_type, format, field_width,[precision]
)
Arguments
●
Argument
data
of data type u
XX
, s
XX
, f
XX
with arbitrary
XX
as defined on page 154.
●
Arguments
format, field_width, precision, conversion_type
of data type u08
Effect
●
conversion_type
○
0: uXX / iXX → decimal notation
○
1: uXX / iXX → octal notation
○
2: uXX / iXX → hexadecimal notation ('x')
○
3: uXX / iXX → hexadecimal notation ('X')
○
4: fXX → floating-point notation
○
5: fXX → exponential notation ('e')
○
6: fXX → exponential notation ('E')
●
format
defines formatting as follows:
○
0: (no effect)
○
1: A blank before a positive number (only permitted if
data
is of data type s
XX
or f
XX
and no conversion into octal or hexadecimal notation)
○
2: A sign before a positive number (only permitted if
data
is of data type s
XX
or f
XX
and no conversion into octal or hexadecimal notation)
○
3: Zero-padded (ignored if
data
is of data type u
XX
or s
XX
and a
precision
is given)
○
4: Zero-padded and a blank before a positive number (only permitted if
data
is of data
type s
XX
or f
XX
and no conversion into octal or hexadecimal notation; ignored if
data
is of data type u
XX
or s
XX
and a
precision
is given)
○
5: Zero-padded and a sign before a positive number (only permitted if
data
is of data
type s
XX
or f
XX
and no conversion into octal or hexadecimal notation; ignored if
data
is of data type u
XX
or s
XX
and a
precision
is given)
○
6: Left-justified
○
7: Left-justified and a blank before a positive number (only permitted if
data
is of data
type s
XX
or f
XX
and no conversion into octal or hexadecimal notation)
○
8: Left-justified and a sign before a positive number (only permitted if
data
is of data
type s
XX
or f
XX
and no conversion into octal or hexadecimal notation)
○
9: Alternative notation (s. man 3 printf) (only permitted if no conversion into decimal
notation)
○
10: Alternative notation (s. man 3 printf) and a blank before a positive number (only
permitted if
data
is of data type f
XX
)
○
11: Alternative notation (s. man 3 printf) and a sign before a positive number (only
permitted if
data
is of data type f
XX
)
○
12: Alternative notation (s. man 3 printf) and zero-padded (only permitted if no
conversion into decimal notation; ignored if
data
is of data type u
XX
or s
XX
and a
precision
is given)
○
13: Alternative notation (s. man 3 printf), zero-padded and a blank before a positive
number ( only permitted if
data
is of data type f
XX
)
○
14: Alternative notation (s. man 3 printf), zero-padded and a sign before a positive
number ( only permitted if
data
is of data type f
XX
)
○
15: Alternative notation (s. man 3 printf) and left-justified (only permitted if no
conversion into decimal notation)
○
16: Alternative notation (s. man 3 printf), left-justified and a blank before a positive
number ( only permitted if
data
is of data type f
XX
)
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]