This fork is rebranded from Number/:number to NumberFormatter/:number_formatter,
published as a new Hex package (number_formatter), so versioning restarts at 1.0.0
rather than continuing upstream's 1.0.x line. Everything below is relative to
upstream v1.0.5.
Breaking changes:
- Renamed every module (
Number->NumberFormatter) and their backing files
(lib/number(.ex|/)->lib/number_formatter(.ex|/), same undertest/). - Renamed the OTP application/config atom from
:numberto:number_formatter.
Existingconfig :number, ...must becomeconfig :number_formatter, .... - Package renamed from
numbertonumber_formatter; repo moved to
Ch4s3/number_formatter. - Upgraded
decimalto~> 3.0, dropping support for~> 1.5/~> 2.0. - Tightened the
elixirversion requirement from~> 1.0to~> 1.16, matching
what's actually tested in CI.
Added:
- Elixir 1.20 support, tested in CI alongside 1.16.
- CI migrated from Semaphore to GitHub Actions.
- Credo static analysis, run as part of
bin/test. - Test coverage for the
use NumberFormattermacro (previously untested).
Fixed:
Conversion.to_float/1andto_decimal/1no longer silently truncate
malformed strings with a valid numeric prefix --to_decimal("123abc")
used to returnDecimal.new(123); it now raisesArgumentError.- Fixed a
Decimal.Errorcrash innumber_to_delimited/2and
number_to_currency/2on float-derived strings with more than 28
significant digits (Decimal 3.x's defaultmax_digits). - Fixed backreference corruption in
Currency.number_to_currency/2and
Phone.number_to_phone/2when a:unitor:delimiteroption contained a
literal backslash-digit sequence (e.g."\1"), which was silently misread
as a regex capture-group reference. - Fixed Elixir 1.19+ deprecation warnings (
preferred_cli_env->cli/0,
single-quoted charlists ->~csigil).
Changed:
- Removed the dead Decimal 1.x
compare/2compatibility shim; call sites now
useDecimal.compare/2directly. - Simplified
Human.number_to_human/2(cyclomatic complexity 11 -> a
data-driven scale list) andDelimit.to_integer/1(explicit try ->
idiomatic implicit try). - Extracted repeated config-loading boilerplate (5 modules) into
NumberFormatter.Config.resolve/2.