beautypg.com

ProSoft Technology ProSoft i-View User Manual

Page 54

background image

Data Source Files

ProSoft i-View ♦ Mobile Process Monitoring and Control Application

User Manual

Version 2.0.2

Page 54 of 106

ProSoft Technology, Inc.

September 29, 2011

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. ProSoft i-View. format specifiers adopt the following form:

%<.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

to_s
method
support

format
function
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