4.13.3 Formatting Codes

<< Click to Display Table of Contents >>

Navigation:  4. Additional Features > 4.13 The Code Definition Window >

4.13.3 Formatting Codes

Additional Features > The Code Definition Window

You can use the Format field to set the output-format of code fields. The format specification consists of optional and required fields:

%{Width}.{Precision}type

Both the percent-sign and the type-field are required.

type                Required. Determines how the argument is interpreted:

d                Integer (lowercase)

f                Decimal digit (lowercase)

S                String (uppercase)        

Please note that the type field is case-sensitive.

width                Optional. Specifies the minimum number of characters output. If width is prefixed with 0, zeroes are added until the minimum width is reached.

precision        Optional. Specifies the number of characters printed or the number of decimal places, depending on the type:

         type = d        à        Precision = minimum number of digits printed.

If the number has less digits than given by precision, the number is preceded by zeros.

         type = f                à Precision = number of digits after the decimal point

         type = S        à Precision = maximum number of characters printed

Examples:

%05s        String with at least 5 digits. Zeroes are added if less than minimum width:        123 à        00123

%.3f                3 decimal digit:        123,456789        à        123.456

%.5d                Integer with at least 5 digits:        123        à        00123