bdavi / number-word

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

number-word

Summary

NumberWord is a command line application which accepts a Ruby integer literal and prints the full English spelling of that number.

Example usage

~$ ruby number_to_word.rb 134
one hundred thirty four

It handles negative numbers and hexadecimal as well:

~$ ruby number_to_word.rb -0xaabb
negative fourty three thousand, seven hundred  and seven

No trouble with binary or underscores:

~$ ruby number_to_word.rb 0b001_001
nine

About


Languages

Language:Ruby 100.0%