Converts a Source String value whose format is user-defined by the Locale parameter into a Number formatted according to the default Java Locale. A common use case is processing invoices or purchase orders from European trading partners whose number formatting conventions differ from the US standard.
| Property | Type | Description |
| Source Value | Number | The source string value. |
| Target Value | String | This is the locale format that you want the target value to be in |
If the number value or Locale is NULL then returns NULL.
The problem it solves
In many European countries, the comma and period in numbers are swapped compared to US/English formatting:
| Region | Format | Meaning |
|---|---|---|
| US (en-US) | 1,000.01 | One thousand and one cent |
| Netherlands (nl-NL) | 1.000,01 | One thousand and one cent |
| Germany (de-DE) | 1.000,01 | One thousand and one cent |
Passing a string value of "1.000,01" defined with the "nl-NL" (Netherlands) locale through this action results in a number with the value 1000.01. Without this conversion, your ruleset would misread the value entirely - interpreting 1.000,01 as just 1.0 or throwing an error.
Scenario: Dutch supplier sending an EDI invoice
A Netherlands-based supplier sends an inbound EDI 810 invoice with line item prices formatted in their local convention. Before your ruleset can do any math - totaling line items, applying discounts, comparing against a PO — the string "2.500,75" needs to become the number 2500.75.
| Property | Value |
|---|---|
| Source Value | "2.500,75" (string from the EDI field) |
| Target Locale | "nl-NL" |
| Result | 2500.75 (usable number) |
From there, the converted number can feed directly into an Add, Multiply, or comparison action without any further cleanup.
Why not just use a standard string-to-number conversion?
A plain conversion would either fail or produce the wrong result because it wouldn't know to treat the comma as the decimal separator. CreateNumberFromStringWithLocale handles that interpretation explicitly via the language tag, making it the right tool any time your source data comes from a non-US locale with a different numeric format.
Comments
0 comments
Please sign in to leave a comment.