markburns / numbers_in_words

A ruby gem to convert numbers into English words and vice versa.

Home Page:http://rubygems.org/gems/numbers_in_words

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for ordinal numbers

elliotchance opened this issue · comments

http://en.wikipedia.org/wiki/Ordinal_number_(linguistics)

I am writing cucumber tests and it would be really neat if I could use:

When I click on the <index> result
Then I should see <text>

Examples:
  | index     | text        |
  | first     | Banana Cake |
  | twentieth | Apple Pie   |

Where:

"first".in_numbers => 1
"twentieth".in_numbers => 20

I guess it's a cool idea in a way. I'm open to pull requests, but this is not a particularly serious project and I don't use it, so I'm really unlikely to implement it myself.
Wouldn't 1st and 20th be more natural in your case, and hence more suited to a matcher?
Closing because it's not a problem with the library, but as I said, happy to consider pull requests.