StringFormatter
Parameters
Specify the attribute(s) to reformat.
Provide the Tcl format command for reformatting the specified attributes. The syntax is:
[flags][width][precision]<type>
Note: A preceding percent sign (%) is not part of the format string.
Flag Characters:
One or more of the following flag characters can be specified:
0 The value should be padded with zeroes instead of spaces.
- The value should be padded on the right-hand side. (The default is to pad on the left.)
+ The numeric value should always be signed.
Field Width:
The optional field width is given as a decimal number. If the value has fewer characters than the field width, it will be padded with spaces.
Field Precision:
The optional precision is given as a period followed by a decimal number.
Attribute Type:
One of the following attribute types must be specified. The attribute value will be converted to the given type, if possible.
d Integer
e Decimal number (scientific notation: -d.ddde+dd)
f Decimal number (floating-point notation: -ddd.ddd)
o Octal number
x Hexadecimal number
s String
Examples:
If the source attribute contains the value spuds the following format strings will give the following results:
Format |
Result |
8s |
spuds |
-08s |
spuds000 |
If the source attribute contains the value 12345.6789 the following format strings will give the following results:
Format |
Result |
e |
1.234568e+004 |
.2f |
12345.68 |
015s |
0000012345.6789 |
If the source attribute contains the value 1234 the following format strings will give the following results:
Format |
Result |
x |
4d2 |
4.4f |
1234.0000 |
+06d |
+01234 |
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Transformer Categories
Technical History
FME Factory Used: @Tcl2
Search FME Community
Search for samples and information about this transformer on the FME Community.