Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Little library to convert human readable strings to numbers.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
README.md
cheddar.gemspec

README.md

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
Something went wrong with that request. Please try again.