0.0
No commit activity in last 3 years
No release in over 3 years
Humanizes numbers.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 5.0
~> 10.0
 Project Readme

humanize-number

Build Status

Humanizes numbers.

Installation

$ gem install humanize-number

Usage

require "humanize-number"

HumanizeNumber.humanize(-20)             # "-20"
HumanizeNumber.humanize(123)             # "123"
HumanizeNumber.humanize(1234)            # "1.23k"
HumanizeNumber.humanize(12345)           # "12.3k"
HumanizeNumber.humanize(123456)          # "123k"
HumanizeNumber.humanize(1234567)         # "1.23m"
HumanizeNumber.humanize(12345678)        # "12.3m"
HumanizeNumber.humanize(123456789)       # "123m"
HumanizeNumber.humanize(1234567890)      # "1.23b"
HumanizeNumber.humanize(12345678901)     # "12.3b"
HumanizeNumber.humanize(123456789012)    # "123b"
HumanizeNumber.humanize(1234567890123)   # "1235b"
HumanizeNumber.humanize(12345678901234)  # "12346b"

License

MIT