An Elixir library for formatting numbers into currencies, percentages, phone numbers, and human-readable formats.
Number is an Elixir library that formats numbers into various human-readable string representations. It provides functions to convert numbers into currencies, phone numbers, percentages, delimited formats, and compact human-readable units. The library solves the problem of consistently presenting numeric data in user interfaces and reports within Elixir applications.
Elixir developers building web applications, APIs, or data processing tools that require formatted number output for display or export. It's particularly useful for those familiar with Rails' number helpers seeking similar functionality in Elixir.
Developers choose Number because it offers a comprehensive, Rails-inspired API for number formatting in Elixir with modular design, allowing selective import of only needed functions. It provides consistent, locale-aware formatting without requiring manual implementation of common number presentation logic.
ActionView::Helpers::NumberHelper for Elixir
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides dedicated submodules for currency, phone numbers, percentages, human-readable numbers, and delimited formats, as shown in the README examples like 'Number.Currency.number_to_currency(2034.46)'.
Allows selective importing of only needed functions from submodules such as Number.Currency, reducing dependency bloat and keeping code clean, as highlighted in the usage section.
Offers a clean, practical API similar to Rails' ActionView::Helpers::NumberHelper, making it easy for developers familiar with Ruby to adopt in Elixir projects.
Badges in the README indicate active testing, coverage, and Hex documentation, ensuring reliability and ease of use for developers.
As a partial clone of Rails helpers, it may not support all international number formats or locales out-of-the-box, requiring custom implementations for non-standard cases.
Focuses solely on formatting numbers to strings, lacking functions to parse formatted strings back into numeric types, which can be a drawback for applications needing bidirectional data conversion.
For basic formatting like adding commas, using Number might introduce unnecessary complexity compared to Elixir's native String or Integer modules, especially in performance-sensitive code.