Skip to content

Commit e4e684a

Browse files
committed
Remove TODO and move the compact-parts deviation into the number guide
1 parent cf2604c commit e4e684a

3 files changed

Lines changed: 4 additions & 17 deletions

File tree

TODO.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

guides/number_formatting.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,9 @@ iex> Localize.Number.to_parts(1234567, format: :decimal_short)
445445
]}
446446
```
447447

448-
The `:currency_long` formats and the RBNF rule-name formats do not decompose into parts and return an error from `to_parts/2`.
448+
The RBNF rule-name formats (`:spellout_cardinal` and friends) do not decompose into parts and return an error from `to_parts/2`.
449+
450+
One known deviation from `Intl.NumberFormat.formatToParts`: the compact affix is a single `:compact` part including any adjoining space (`" million"`), where JS emits the space as a separate `:literal` part. Callers needing exact JS part boundaries can split leading/trailing whitespace off the `:compact` part.
449451

450452
### Rounding mode examples
451453

guides/unit_formatting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ Units are organized into dimensional categories. Common categories and represent
589589

590590
## Custom units
591591

592-
`Localize.Unit.define_unit/2` registers user-defined units at runtime via the `Localize.Unit.CustomRegistry`. Custom units participate in conversion, formatting, and arithmetic alongside built-in CLDR units.
592+
`Localize.Unit.define_unit/2` registers user-defined units at runtime via the `Localize.Unit.CustomRegistry`. Custom units participate in conversion, formatting, arithmetic, and parsing alongside built-in CLDR units. Hyphenated names ("double-cubit") are supported — a registered name matches wholesale before the unit grammar interprets hyphens as compound separators, just as CLDR's own hyphenated identifiers ("g-force", "kilowatt-hour") do.
593593

594594
### Linear custom units
595595

0 commit comments

Comments
 (0)