// n8n integration
This operation is available on both n8n Cloud and self-hosted n8n and requires the CustomJS community package. It ships with the next release of the @custom-js/n8n-nodes-pdf-toolkit-v2 package, available from version 0.12.0. See Installation.
The Parse Localized Number operation converts number strings from invoices, CSV exports, scraped websites, and user input into real numbers. Formats that break a plain parseFloat are handled correctly:
"1.234,56 EUR" becomes 1234.56"$1,234.56" becomes 1234.56"(500)" becomes -500"1'234.56" becomes 1234.56By default the format is detected automatically. If your data source is known to be European or US formatted, you can pin the format to avoid ambiguity (e.g. "1.234" could be one thousand two hundred thirty four in EU format, or 1.234 in US format).
The operation lives in the CustomJS (PDF & File Toolkit) node:
DataParse Localized Number| Parameter | Description | Required |
|---|---|---|
| Value | The localized number text to parse, e.g. "1.234,56 EUR" or "$1,234.56" | Yes |
| Number Format | Auto Detect, EU (1.234,56), or US (1,234.56) | No (default: Auto Detect) |
Input:
Value: "1.234,56 EUR"
Number Format: Auto Detect
Output:
{
"number": 1234.56,
"rounded": 1234.56,
"isNegative": false,
"detectedFormat": "decimal comma (eu)",
"originalText": "1.234,56 EUR"
}
| Field | Description |
|---|---|
| number | The parsed number, full precision |
| rounded | The number rounded to 2 decimal places, handy for currency values |
| isNegative | true for negative values, including accounting style "(500)" |
| detectedFormat | Which format was detected or applied, useful for debugging |
| originalText | The original input text, unchanged |
If no digits can be found in the input, the node throws a clear error so you can catch it with n8n's error handling.