Project

cheddar

0.01
No commit activity in last 3 years
No release in over 3 years
Convert human readable strings to numbers. Also handles gangster terminology.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Cheddar - Transform that hard-earned cheese into real integers or Fixnums.

Cheddar is a little library for converting human input strings into numbers.

Installation

gem install cheddar

or add the following line to your Gemfile:

gem 'cheddar'

and run bundle install from your shell.

Examples

The basics.

require 'cheddar'

'15 hundred'.human_to_number
# => 1500

'$200 million'.human_to_number
# => 200000000

'15.72 vigintillion'.human_to_number
# => 1.5720000000000002e+64

Slightly more advanced.

'25 bucks'.human_to_number
# => 25

'20 large'.human_to_number
# => 2000

'33 straight up large bills'.human_to_number
# => 3300