Sha256: c6b2742a0c7328d2e7f359a272af079fcdb5fd8c125374b04a4aa77ee53bf416
Contents?: true
Size: 755 Bytes
Versions: 152
Compression:
Stored size: 755 Bytes
Contents
# frozen_string_literal: true { en: { number: { nth: { ordinals: lambda do |_key, options| number = options[:number] case number when 1; "st" when 2; "nd" when 3; "rd" when 4, 5, 6, 7, 8, 9, 10, 11, 12, 13; "th" else num_modulo = number.to_i.abs % 100 num_modulo %= 10 if num_modulo > 13 case num_modulo when 1; "st" when 2; "nd" when 3; "rd" else "th" end end end, ordinalized: lambda do |_key, options| number = options[:number] "#{number}#{ActiveSupport::Inflector.ordinal(number)}" end } } } }
Version data entries
152 entries across 146 versions & 18 rubygems