Download ScadaMobile 2_4_0

Transcript
ScadaMobile
!
3.1.11.5 The format specifiers and the format function
The built-in function format returns a string formatted according to a format string like the usual printf conventions of the C language. In addition, format accepts %b for binary. ScadaMobile. format specifiers adopt the following form:
%<flags><width><.precision>specifier
Where specifier is the most significant one and defines the type and the interpretation of the value of the corresponding argument (‘<‘ and ‘>’ denote optional fields).
Note that the string provided for the format tag attribute or the format string passed to the to_s method have a slightly different
purpose and may have less available options.
The following format conversion specifiers are available:
FORMAT
SPECIFIER
Description
format attribute
support
format function
support
to_s method
support
b
Binary integer
YES
YES
YES
c
Single character
NO
YES
YES
d,i
Decimal integer
YES
YES
YES
e
Exponential notation (e.g., 2.44e6)
YES
YES
YES
E
Exponential notation (e.g., 2.44E6)
YES
YES
YES
f
Floating-point number (e.g., 2.44)
YES
YES
YES
g
Use the shorter of e or f
YES
YES
YES
G
Use the shorter of E or f
YES
YES
YES
o
Octal integer
NO
YES
YES
s
String or any object converted using to_s
NO
YES
YES
u
Unsigned decimal integer
YES
YES
YES
x
Hexadecimal integer (e.g., 39ff)
YES
YES
YES
X
Hexadecimal integer (e.g., 39FF)
YES
YES
YES
For the meaning and possible contents of the optional flags, width, and precision fields refer to the sprintf specification:
http://www.cplusplus.com/reference/clibrary/cstdio/sprintf/
Note that since there is no need for it the length field is not available neither in Ruby or ScadaMobile.
pag:60/ 101!
www.sweetwilliamsl.com