[1.2.0] — August 16th, 2026
Changed
-
Breaking.
Localize.Number.Parser.scan/2now treats a space as a grouping separator in locales that group with one, so runs of digits that it previously returned separately can come back as a single number. Underfr,"chambres 12 14 16"was["chambres ", 12, " ", 14, " ", 16]and is now["chambres ", 121416]; passlenient: falseto require exact grouping sizes and get the old result. This is what lets"1 234,5"be found as one number, which is the point of the change. -
Breaking.
Localize.Number.parse/2andscan/2validate that grouping separators sit in plausible positions, matching ICU, so input that was previously accepted can now fail. Underfr,parse("3 4")was{:ok, 34}and is now an error, because a single digit is not a group in any locale. -
Localize.Number.parse/2andLocalize.Number.Parser.scan/2take a:lenientoption governing that validation.true, the default, requires each group to be at least two digits, which is ICU's lenient rule;falserequires exactly the locale's grouping size — three for most locales, and the 3-then-2 ofen-IN.
Fixed
-
Localize.Number.Parser.scan/2finds a grouped number written with an ordinary keyboard space in a locale that formats with U+202F. Underfr,scan("1 234,5")was[1, " ", 234.5]and is now[1234.5]. -
Localize.Number.parse/2treats every character in[:Zs:]as a grouping space, per TR35's loose matching for lenient parsing. It previously accepted only U+0020 and the locale's own separator, so afrnumber carrying U+00A0 or U+2009 — as copied out of formatted output — failed to parse. -
Localize.Number.parse/2ignores every character in[:Cf:], per the same passage's instruction to ignore format characters, "in particular ... any RLM, LRM or ALM used to control BIDI formatting". CLDR writes the minus sign ofar,he,faand 16 other locales as a BIDI mark followed by the sign, so a negative number copied out of that text previously failed to parse. -
Localize.Number.parse/2applies CLDR'sparseLenientscharacter folds, which were generated into the locale data but never read. The minus, plus, comma and full-stop families now fold to their canonical form, so the 18 locales writingminusSignas U+2212 —fa,fi,svandnoamong them — parse their own negative numbers back. Per TR35 the fold applies to the locale's own separators as well as the input, which is what letsde-CHaccept both spellings of its apostrophe group separator.