This data converter finds and extracts a number and outputs it in the standard number format.
Note: If a number that is already in the standard number format should be reformatted, use the Format Number data converter instead.
The Extract Number data converter is configured using the following properties:
The format pattern provides a very flexible way of specifying the number format. However, the rules for specifying the pattern can be somewhat difficult to understand, so finding the default pattern that matches the required format in the best possible way, and then experimenting with changing that default pattern might be an easier solution.
In a pattern, the following special characters can be used:
Special Character | Meaning |
---|---|
0 | A digit. |
# | A digit, but zero is not shown. |
. | The decimal separator, i.e. the character specified in the Decimal Separator field. |
, | The thousands separator, i.e. the character specified in the Thousands Separator field. |
- | The minus sign, i.e. the character specified in the Minus Sign field. |
E | In scientific notation, separates the mantissa and the exponent. |
Note that in the pattern, the '.' character is always used to select the decimal separator, regardless of what is entered in the Decimal Separator field. The '.' character will then be replaced by the character in the Decimal Separator field when the number is formatted. The same applies to the thousands separator and minus sign.
Separate patterns can be specified for positive and negative numbers. This is done by specifying two patterns separated by semicolon (';'). For example, use the pattern "#,##0.00;(#,##0.00)" if you want negative numbers to be parenthesized instead of the default where the minus sign character is placed in front of negative numbers.
If the input uses scientific notation with a large exponent (e.g. the number 6.023E23), Convert to Integer should generally not be checked, since conversion of such large numbers to integers may give inappropriate results.
Consider this input:
Price is USD 33,555.77.
With Format Pattern set to "###0.0", Decimal Separator set to ".", Thousands Separator set to ",", Minus Sign set to "-", Multiply By set to "1.0", Convert to Integer not checked, and no Constants configured, the number 33555.77 is extracted.
In the example above, if Convert to Integer is checked, the number 33556 is extracted.
Now, consider this input:
Price is USD 10.5 mill.
With Format Pattern set to "0.000", Decimal Separator set to ".", Thousands Separator set to ",", Minus Sign set to "-", Multiply By set to "1.0", Convert to Integer checked, and Constants set to mill.=1000000.0 and bill.=1000000000.0, the number 10500000 is extracted.
In the example above, if Convert to Integer is not checked, the number 1.05E7 is extracted.