number icon indicating copy to clipboard operation
number copied to clipboard

Add an option to number_to_human for short labels

Open Billzabob opened this issue 4 years ago • 0 comments

The labels are currently hardcoded to Thousand, Million, Billion, Trillion, or Quadrillion. It would be nice to be able to pass a list of these yourself as one of the options, similar to how millify does it. For example:

iex> Number.Human.number_to_human(1440000, units: ["B", "KB", "MB", "GB", "TB"])
1.44 MB

Billzabob avatar Dec 08 '21 18:12 Billzabob