Project

hundredth

0.0
No commit activity in last 3 years
No release in over 3 years
Writes out 1 to 100 as ordinal words. For example first, second, third, etc. For numbers 101 and greater are are written out using the number followed by the ordinal indicator, e.g. 'st', 'nd', 'rd'. Supported languages are English, French, and Spanish. For example: 1 = first 2 = second 100 = hundredth 101 = 101st
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
~> 0
~> 0.58.2
~> 5.5, >= 5.5.1

Runtime

~> 1.1
 Project Readme

Hundredth

Writes out 1 to 100 as ordinal words. For example first, second, third, etc. For numbers 101 and greater are are written out using the number followed by the ordinal indicator, e.g. 'st', 'nd', 'rd'. Supported languages are English, French, and Spanish.

For example: 1 = first 2 = second 100 = hundredth 101 = 101st

Aren't there other ordinal gems?

Yeah, there are. However, they either are not internationalized or have bugs.

What languages are currently supported?

  • English
  • French *
  • Spanish *

* Are not supported over 100

Installation

Add this line to your application's Gemfile:

gem 'hundredth'

And then execute:

$ bundle

Or install it yourself as:

$ gem install hundredth

Usage

Once hundredth is added as a gem, then you basically call it this way.

Hundredth.ordinal(2)

The above call with use the current locale. If you want to pass in a different locale then you can call it like this:

Hundredth.ordinal(2, 'en')

You can also set the default locale:

Hundredth.default_locale = 'en'

Contributing

  1. Fork it ( https://github.com/jcavalieri/hundredth/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Make your changes to code and tests
  4. Test it
    bundle install
    bundle exec ruby -Ilib:test test/*
    
  5. Commit your changes (git commit -am 'Add some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create a new Pull Request