Method: Humanize::De#humanize
- Defined in:
- lib/humanize/locales/de.rb
#humanize(number) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/humanize/locales/de.rb', line 5 def humanize(number) iteration = 0 parts = [] use_and = false until number.zero? number, remainder = number.divmod(1000) unless remainder.zero? if iteration.zero? && remainder < 100 use_and = true else add_grouping(parts, use_and, iteration) end parts << SUB_ONE_GROUPING[remainder] end iteration += 1 end parts end |