Number Format
Re-interpret values using a specific number format, e.g. 100.000 to 100,000
parseNumbersInColumns:
locale: "<insert locale>"
When reading a numeric field Quantemplate will use US/GB
number formatting, interpreting commas as group separators and periods as the
decimal point.
Example
Quantemplate default:
Input value = 1,234,567.89
Quantemplate interprets as 1234567.89
For files from alternative locales the parseNumbersInColumns
operation can be used to reinterpret these values. To identify the locale, use an
ISO
2-character country code.
The 2 character country code must be lower case in the script.
Example
Quantemplate default
Input value = 1.234.567,89
Quantemplate interprets as 1.23456789
If a number format operation is added:
Locale: “fr”
Input value = 1.234.567,89
Quantemplate interprets as 1234567.89
The number format operation will be applied to all
values found in the stage inputs. If number formatting is only required on
specific columns, use the optional onlyColumns argument to identify them.
Example
parseNumbersInColumns:
locale: "<insert locale>"
onlyColumns:
- "Amount"
- "Premium"
The number format operation should be used in the
first stage of your pipeline, before any operations which use column values
(e.g. calculations).