Format Characters for Methods That Print
This topic describes format characters for methods that print. The following methods can perform print operations:
Each of these methods prints each character while it reads the input until the method encounters a percentage symbol (%). This symbol instructs that method to use the following format to print a value:
%[flags][width][.precision]type
To include the % symbol as a character in the string, you use two consecutive percentage symbols (%%).
Characters That Format Values
The following table describes characters that format a value.
Character | Description | Example Statement and Output |
---|---|---|
- |
Left justification in the field with space padding or right justification with zero or space padding. |
|
+ |
Force numbers to begin with a plus symbol (+) or a minus symbol (-). |
|
space |
A negative value that begins with a minus symbol (-). A positive value begins with a space. |
|
# |
Append one of the following symbols to the pound (#) character to display the output in one of the following forms:
|
|
f |
Floating-point of the format [-]dddd.dddd. |
|
e |
Floating-point of the format [-]d.ddde+dd or [-]d.ddde-dd. |
|
E |
Floating-point of the format [-]d.dddE+dd or [-]d.dddE-dd. |
|
g |
Floating-point number of f or e type, depending on precision. |
|
G |
Floating-point number of F or E type, depending on precision. |
|
c |
Character. For example, a, b, or 8. |
|
s |
String. |
|
Characters That Determine Width
The following table describes characters that determine width.
Character | Description | Example Statement and Output |
---|---|---|
n |
At least n characters are output. If the value is less than n characters, then Siebel eScript pads that precedes the output with spaces. |
|
0n |
At least n characters are output pads that precedes the output with zeros. |
|
* |
The next value in the argument list is an integer that specifies the output width. |
|
Characters That Determine Precision
The following table describes characters that determine precision. If you specify precision, then you must begin the precision format with a period (.) and you must use one of the forms described in Format Characters for Methods That Print.
Character | Description | Example Statement and Output |
---|---|---|
.0 |
For floating-point type. No decimal point is output. |
|
.n |
Output is n characters. If the value is a floating-point number, then the output is n decimal places. Assume you specify a Width value and a .n Precision value when you format a floating point number. In this situation, to determine the width of the output and to determine if it must pad the output, the method counts the decimal point and the characters that occur before and after the decimal point. For example:
|
|
.* |
The next value in the argument list is an integer that specifies the precision width. |
|
Characters That Determine Character Type
The following table describes characters that determine character type.
Character | Description | Example Statement and Output |
---|---|---|
d,i |
Signed integer. |
|
u |
Unsigned integer. |
|
o |
Octal integer. |
|
x |
Hexadecimal integer using 0 through 9 and a, b, c, d, e, or f. |
|
X |
Hexadecimal integer using 0 through 9 and A, B, C, D, E, or F. |
|
f |
Floating-point of the format [-]dddd.dddd. |
|
e |
Floating-point of the format [-]d.ddde+dd or [-]d.ddde-dd. |
|
E |
Floating-point of the format [-]d.dddE+dd or [-]d.dddE-dd. |
|
g |
Floating-point number of f or e, depending on precision. |
|
G |
Floating-point number of F or E, depending on precision. |
|
c |
Character. For example, a, b, 8. |
|
s |
String. |
|