FormatNumberToLocale
Evaluates the current field value for known number patterns and if a known pattern is detected, updates the decimal and digit separators characters to match that of the current locale.
Syntax
bool FormatNumberToLocale ()
Parameters
Smart parameters are supported.
Returns
True, if no errors are encountered. Otherwise, False.Level
Field level.Details
This action evaluates the current field value for known number patterns, If a known pattern is detected, the action updates the decimal and digit separators characters (if present) to match the current locale. For use when processing fields with number types formatted incorrectly for the current locale, such as US versus European locales. Known patterns are industry standard digits with or without 3-digit group separators, and 1-2 digits following a decimal separator.Distinct Analyzed groups:
- Numerals with decimal point
- Group Separators using comma, apostrophe, or space characters.
- Decimal Separator using decimal character.
- Numerals with decimal comma
- Group Separator using decimal, apostrophe, or space characters.
- Decimal Separator using comma character.
- Numerals with Arabic/Persian characters
- Group Separator using Arabic/Persian character.
- Decimal Separator using Arabic/Persian character.
Note: Numerals with lakhs layout and decimal mark (pattern of n,nn,nn,nnn.dd)
are not supported.
- Example
a) Given a US number 1,234.56 to be formatted to UK. FormatNumberToLocale() New format will be 1.234,56 b) Given a US number 1234.5 to be formatted to UK. FormatNumberToLocale() New format will be 1234,5 c) Given a US number 1,234.567 to be formatted to UK. FormatNumberToLocale() Format will remain 1,234.567 since 3 digits following the decimal are not supported. d) Given a US number 12345678.90 to be formatted to UK. FormatNumberToLocale() New format will be 12345678.90 e) Given a UK number 1.234.567,89 to be formatted to US. FormatNumberToLocale() New format will be 1,234,567.89 f) Given a UK number 0,5 to be formatted to US. FormatNumberToLocale() New format will be 0.5