beautypg.com

Visara Master Console Center Scripting Guide User Manual

Page 114

background image

Chapter 5 Script Commands

Scripting Guide

114

A field width can be indicated by an * (asterisk) instead of a
digit string. In this case, an integer value parameter supplies
the field width. The value parameter converted for output is
not fetched until the conversion letter is reached, so the
parameters specifying field width or precision must appear
before the value (if any) to be converted. If the corresponding
parameter has a negative value, it is treated as a left
alignment option followed by a positive field width. When
variable ordering with the %digit$ format is used, the *
(asterisk) specification for field width in precision is replaced
by *digit$.

ƒ

An optional precision. The precision is a . (dot) followed by a decimal
digit string. If no precision is given, the decimal digit string is treated
as 0 (zero). The precision specifies the minimum number of digits to
appear for the d, o, x, or X conversions. A field precision can be
indicated by an * (asterisk) instead of a digit string. In this case, an
integer value parameter supplies the field precision. The value
parameter converted for output is not fetched until the conversion
letter is reached, so the parameters specifying field width or precision
must appear before the value (if any) to be converted. If the value of
the corresponding parameter is negative, the value is treated as if the
precision had not been specified. When variable ordering with the
%digit$ format is used, the * (asterisk) specification for field width in
precision is replaced by *digit$.

ƒ

A character that indicates the type of conversion to be applied:
%

Performs no conversion. A literal percent sign.

c

Accepts an integer value and converts it to an unsigned ASCII
character.

d

Accepts an integer and converts it to a signed decimal number.

o

Accepts an integer value and converts it to unsigned octal
notation. The precision specifies the minimum number of
digits to appear. If the value being converted can be
represented in fewer digits, it is expanded with leading zeros.
The default precision is 1. The result of converting a 0 (zero)
value with a precision of 0 (zero) is a null string. Specifying a
field width with a 0 (zero) as a leading character causes the
field width value to be padded with leading zeros. An octal
value for field width is not implied.

s

Accepts a string and copies (or pads) it until the specified
precision is reached.