Field-Map Scripting

3.3 Format strings

Format strings


These Delphi Object Pascal format strings (and width and precision specifiers) are recognized in Field-Map Scripting. FORMAT attributes:

format string

meaning

specifier definition

example value

(read the Field-Map database)

example syntax

example output

d

decimal

The argument must be an integer value. The value is converted to a string of decimal digits.

-123

123

-123

-123

-123

%d (or %4d)

%4d

%5d

%.4d (or %5.4d)

%8.5d

-123

0123

_-123

-0123

__-00123

e

scientific

The argument must be a floating-point value. For numbers with exponent part.

12345.678

%e

1.23456780000000E+004

f

fixed

The argument must be a floating-point value. The resulting string starts with a minus sign if the number is negative.

12345.678

12345.000

12345.678

12345.678

12345.678

12345.678

12345.678

12345.678

12345.678

%f (or %8f)

%f

%9f

%.4f (or %10.4f)

%11.4f

%.1f (or %7.1f)

%8.1f

%.0f (or %5.0f)

%6.0f

12345.68

12345.00

_12345.68

12345.6780

_12345.6780

12345.7

_12345.7

12346

_12346

g

general

The argument must be a floating-point value. The value is converted to the shortest possible decimal string. (A decimal point appears only if necessary.)

12345.678

12345.000

%g

%g

12345.678

12345


n

number

The argument must be a floating-point value. The "n" format corresponds to the "f" format, except that the resulting string contains thousand separators.

1234567.00

1234567.00

%n

%.0n

1 234 567.00

1 234 567

m

money

The argument must be a floating-point value. The value is converted to a string that represents a currency amount and reflects the regional settings of the operating system.

1234

1234

%m

%.0m

1 234,00p.

1 234p.


(for "Regional and Language Options" in the operating system set to Russian)

s

string

The argument must be a character or a string value. The string or character is inserted in place of the format string.

Picea abies

Picea abies

%s

Species: %s

Picea abies

Species: Picea abies

x

hexa-

decimal

The argument must be an integer value. The value is converted to a string of hexadecimal digits.

140

%x

8C

For more information, refer to any documentation on Delphi Object Pascal format, width and precision specifiers.



See also:

What is Field-Map Object Pascal; Borland Object Pascal features supported in Field-Map Object Pascal; Format strings; Field-Map Object Pascal specifics