Fixes#2217
Summary:
The fromDecimal function now correctly handles the 'Auto' delimiter mode,
similar to fromHex. Previously, when delim='Auto' (the default), it would
only parse the first number, ignoring subsequent numbers regardless of
the separator used.
Changes:
- src/core/lib/Decimal.mjs:
* When delim='Auto', use regex /[^\d-]+/ to split on any non-digit,
non-minus character (automatically detecting delimiters)
* Filter out empty strings from split result
* Matches the behavior of fromHex's Auto mode
- tests/operations/tests/FromDecimal.mjs:
* Added test cases for Auto delimiter with space, comma, and mixed separators
* Ensures Auto mode correctly parses multiple numbers with various delimiters
Before:
Input: "72 101 108 108 111" (Auto delimiter)
Output: Only parsed 72 (first number)
After:
Input: "72 101 108 108 111" (Auto delimiter)
Output: Correctly parsed all numbers → "Hello"