diff --git a/CHANGELOG.md b/CHANGELOG.md index fb6fe545..16d78849 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.7.1 (April 22, 2013) + +### Bugs + * Wrong hundreds separator with British. \[[#62](https://github.com/kslazarev/numbers_and_words/issues/62)\] \([@kslazarev](https://github.com/kslazarev)\) + ## 0.7.0 (April 14, 2013) ### Features diff --git a/lib/numbers_and_words/i18n/locales/numbers.en-GB.yml b/lib/numbers_and_words/i18n/locales/numbers.en-GB.yml index e1ff4085..7236e3fb 100644 --- a/lib/numbers_and_words/i18n/locales/numbers.en-GB.yml +++ b/lib/numbers_and_words/i18n/locales/numbers.en-GB.yml @@ -11,7 +11,7 @@ en-GB: tens: [zeroth, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth] hundreds: hundredth mega: [zeroth, thousandth, millionth, billionth, trillionth, quadrillionth, quintillionth, sextillionth, septillionth, octillionth, nonillionth, decillionth] - fraction_separator: and + union_separator: point micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths] tenths: one: tenth @@ -52,4 +52,4 @@ en-GB: decillionths: one: decillionth other: decillionths - union: point \ No newline at end of file + union: and \ No newline at end of file diff --git a/lib/numbers_and_words/i18n/locales/numbers.en.yml b/lib/numbers_and_words/i18n/locales/numbers.en.yml index c1c15529..58ae6b88 100644 --- a/lib/numbers_and_words/i18n/locales/numbers.en.yml +++ b/lib/numbers_and_words/i18n/locales/numbers.en.yml @@ -11,7 +11,7 @@ en: tens: [zeroth, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth] hundreds: hundredth mega: [zeroth, thousandth, millionth, billionth, trillionth, quadrillionth, quintillionth, sextillionth, septillionth, octillionth, nonillionth, decillionth] - fraction_separator: and + union_separator: and micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths] tenths: one: tenth diff --git a/lib/numbers_and_words/i18n/locales/numbers.hu.yml b/lib/numbers_and_words/i18n/locales/numbers.hu.yml index 61cc3691..9099c065 100644 --- a/lib/numbers_and_words/i18n/locales/numbers.hu.yml +++ b/lib/numbers_and_words/i18n/locales/numbers.hu.yml @@ -6,6 +6,7 @@ hu: tens_with_ones: [nulla, tizen, huszon, harminc, negyven, ötven, hatvan, hetven, nyolcvan, kilencven] hundreds: száz mega: [egy, ezer, millió, milliárd, billió, billiárd, trillió, trilliárd, kvadrillió, kvadrilliárd, kvintillió, kvintilliárd] + union_separator: egész union: egész ordinal: ones: [nulladik, első, második, harmadik, negyedik, ötödik, hatodik, hetedik, nyolcadik, kilencedik] diff --git a/lib/numbers_and_words/i18n/locales/numbers.ru.yml b/lib/numbers_and_words/i18n/locales/numbers.ru.yml index 0e202398..13880462 100644 --- a/lib/numbers_and_words/i18n/locales/numbers.ru.yml +++ b/lib/numbers_and_words/i18n/locales/numbers.ru.yml @@ -7,6 +7,7 @@ ru: teens: [десять, одиннадцать, двенадцать, тринадцать, четырнадцать, пятнадцать, шестнадцать, семнадцать, восемнадцать, девятнадцать] tens: [ноль, десять, двадцать, тридцать, сорок, пятьдесят, шестьдесят, семьдесят, восемьдесят, девяносто] hundreds: [ноль, сто, двести, триста, четыреста, пятьсот, шестьсот, семьсот, восемьсот, девятьсот] + union_separator: 'и' union: 'и' micro: one: [_, десятая, сотая, тысячная, миллионная, миллиардная, триллионная] diff --git a/lib/numbers_and_words/i18n/locales/numbers.ua.yml b/lib/numbers_and_words/i18n/locales/numbers.ua.yml index 17abf30a..0fea9fd9 100644 --- a/lib/numbers_and_words/i18n/locales/numbers.ua.yml +++ b/lib/numbers_and_words/i18n/locales/numbers.ua.yml @@ -7,6 +7,7 @@ ua: teens: [десять, одинадцять, дванадцять, тринадцять, чотирнадцять, п’ятнадцять, шiстнадцять, сiмнадцять, вiсiмнадцять, дев’ятнадцять] tens: [нуль, десять, двадцять, тридцять, сорок, п’ятдесят, шiстдесят, сiмдесят, вiсiмдесят, дев’яносто] hundreds: [нуль, сто, двiстi, триста, чотириста, п’ятсот, шiстсот, сiмсот, вiсiмсот, дев’ятсот] + union_separator: 'i' union: 'i' micro: one: [_, десята, сота, тысячна, мiльйонна, мiльярдна, трильйонна] diff --git a/lib/numbers_and_words/strategies/array_joiner/languages/families/base.rb b/lib/numbers_and_words/strategies/array_joiner/languages/families/base.rb index 2f8e984e..d6debf33 100644 --- a/lib/numbers_and_words/strategies/array_joiner/languages/families/base.rb +++ b/lib/numbers_and_words/strategies/array_joiner/languages/families/base.rb @@ -14,7 +14,7 @@ def union_element end def union_separator - options[:union_separator] || @translations.union || '' + options[:union_separator] || @translations.union_separator || '' end end end diff --git a/lib/numbers_and_words/translations/families/base.rb b/lib/numbers_and_words/translations/families/base.rb index d8740f94..8f58b567 100644 --- a/lib/numbers_and_words/translations/families/base.rb +++ b/lib/numbers_and_words/translations/families/base.rb @@ -27,6 +27,10 @@ def mega capacity def union t :union end + + def union_separator + t :union_separator + end end end end diff --git a/lib/numbers_and_words/version.rb b/lib/numbers_and_words/version.rb index 843095dc..43032e9a 100644 --- a/lib/numbers_and_words/version.rb +++ b/lib/numbers_and_words/version.rb @@ -1,3 +1,3 @@ module NumbersAndWords - VERSION = '0.7.0' + VERSION = '0.7.1' end diff --git a/numbers_and_words.gemspec b/numbers_and_words.gemspec index 88f0de84..eb3a32a3 100644 --- a/numbers_and_words.gemspec +++ b/numbers_and_words.gemspec @@ -5,11 +5,11 @@ Gem::Specification.new do |s| s.name = "numbers_and_words" - s.version = "0.7.0" + s.version = "0.7.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Kirill Lazarev"] - s.date = "2013-04-14" + s.date = "2013-04-22" s.description = "Convert numbers to words using I18N." s.email = "k.s.lazarev@gmail.com" s.extra_rdoc_files = [ diff --git a/spec/numbers_and_words/integer/fixture_examples/en-GB.yml b/spec/numbers_and_words/integer/fixture_examples/en-GB.yml index e9670887..a35f5fe4 100644 --- a/spec/numbers_and_words/integer/fixture_examples/en-GB.yml +++ b/spec/numbers_and_words/integer/fixture_examples/en-GB.yml @@ -100,4 +100,14 @@ to_words: 42000: forty-two thousandth 420000: four hundred twenty thousandth 4200000: four million two hundred thousandth - 42000000: forty-two millionth \ No newline at end of file + 42000000: forty-two millionth + hundred_with_union: + options: + :hundreds_with_union: true + 0: zero + 100: one hundred + 111: one hundred and eleven + 1111: one thousand one hundred and eleven + 100100: one hundred thousand one hundred + 100111: one hundred thousand one hundred and eleven + 111111: one hundred and eleven thousand one hundred and eleven