BetterNumber
https://hexdocs.pm/better_number
It is a fork of @danielberkompas 's number library for number’s formatting to different formats like percentage or currency
-
Has slightly more features
-
Does not perform any configuration lookups and therefore each function is 100% pure.
-
More performant, since there are no configuration lookups.
-
Idiomatic. Has no
__using__
to import functions. -
Has correct type specifications.
-
Actively maintained.
BetterNumber in action:
alias BetterNumber, as: Number
Number.Currency.number_to_currency(2034.46)
"$2,034.46"
Number.Phone.number_to_phone(1112223333, area_code: true, country_code: 1)
"+1 (111) 222-3333"
Number.Percentage.number_to_percentage(100, precision: 0)
"100%"
Number.Human.number_to_human(1234)
"1.23 Thousand"
Number.Delimit.number_to_delimited(12345678)
"12,345,678"