Sha256: ba50f03fc131a76449c8042819fbc9ad9cf88cea2548047d756834c0b291f35c
Contents?: true
Size: 283 Bytes
Versions: 6
Compression:
Stored size: 283 Bytes
Contents
class Integer def pluralize desc if self == 0 "no #{desc.to_s.pluralize}" elsif self == 1 "#{self} #{desc}" else "#{self.dotted} #{desc.to_s.pluralize}" end end def dotted self.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1.').reverse end end
Version data entries
6 entries across 6 versions & 1 rubygems