Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Parse numbers in natural language from strings (ex forty two).
Ruby
branch: master

README.rdoc

Numerizer

Numerizer is a gem to help with parsing numbers in natural language from strings (ex forty two). It was extracted from the awesome Chronic gem github.com/evaryont/chronic.

Installation

$ sudo gem sources -a http://gemcutter.org
$ sudo gem install numerizer

Usage

>> require 'numerizer'
=> true
>> Numerizer.numerize('forty two')
=> "42"
>> Numerizer.numerize('two and a half')
=> "2.5"
>> Numerizer.numerize('three quarters')
=> "3/4"
>> Numerizer.numerize('two and three eighths')
=> "2.375"

Contributors

Tom Preston-Werner, John Duff

Something went wrong with that request. Please try again.