sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

Integer#ordinalize

Ordinalize turns a number into an ordinal string used to denote the
position in an ordered sequence such as 1st, 2nd, 3rd, 4th.

 1.ordinalize     # => "1st"
 2.ordinalize     # => "2nd"
 1002.ordinalize  # => "1002nd"
 1003.ordinalize  # => "1003rd"
 -11.ordinalize   # => "-11th"
 -1001.ordinalize # => "-1001st"

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/core_ext/integer/inflections.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Integer-ordinalize-for-pr


# Commit to git

git add app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/core_ext/integer/inflections.rbgit commit -m "better docs for Integer#ordinalize"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Integer-ordinalize-for-pr

hub pull-request


# Celebrate!