numbers_and_words 0.11.2 → 0.11.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.rdoc +23 -5
- data/lib/numbers_and_words.rb +2 -0
- data/lib/numbers_and_words/core_ext.rb +2 -0
- data/lib/numbers_and_words/core_ext/array.rb +2 -0
- data/lib/numbers_and_words/core_ext/float.rb +2 -0
- data/lib/numbers_and_words/core_ext/integer.rb +2 -0
- data/lib/numbers_and_words/helper_classes.rb +2 -0
- data/lib/numbers_and_words/helper_classes/array_extensions/helpers.rb +6 -4
- data/lib/numbers_and_words/helper_classes/figures_array.rb +2 -0
- data/lib/numbers_and_words/helper_classes/words_array.rb +2 -0
- data/lib/numbers_and_words/i18n.rb +2 -0
- data/lib/numbers_and_words/i18n/initialization.rb +2 -0
- data/lib/numbers_and_words/i18n/locales/numbers.cs.yml +37 -26
- data/lib/numbers_and_words/i18n/locales/numbers.de.yml +5 -4
- data/lib/numbers_and_words/i18n/locales/numbers.en-GB.yml +24 -8
- data/lib/numbers_and_words/i18n/locales/numbers.en.yml +10 -6
- data/lib/numbers_and_words/i18n/locales/numbers.es.yml +6 -5
- data/lib/numbers_and_words/i18n/locales/numbers.et.yml +4 -4
- data/lib/numbers_and_words/i18n/locales/numbers.fr.yml +45 -41
- data/lib/numbers_and_words/i18n/locales/numbers.hu.yml +11 -7
- data/lib/numbers_and_words/i18n/locales/numbers.hy.yml +7 -0
- data/lib/numbers_and_words/i18n/locales/numbers.it.yml +3 -3
- data/lib/numbers_and_words/i18n/locales/numbers.ka.yml +6 -14
- data/lib/numbers_and_words/i18n/locales/numbers.lt.yml +4 -5
- data/lib/numbers_and_words/i18n/locales/numbers.lv.yml +4 -5
- data/lib/numbers_and_words/i18n/locales/numbers.nl.yml +4 -3
- data/lib/numbers_and_words/i18n/locales/numbers.pt-BR.yml +51 -22
- data/lib/numbers_and_words/i18n/locales/numbers.pt.yml +21 -8
- data/lib/numbers_and_words/i18n/locales/numbers.ru.yml +39 -27
- data/lib/numbers_and_words/i18n/locales/numbers.se.yml +3 -3
- data/lib/numbers_and_words/i18n/locales/numbers.tr.yml +3 -3
- data/lib/numbers_and_words/i18n/locales/numbers.ua.yml +39 -15
- data/lib/numbers_and_words/i18n/locales/numbers.vi.yml +13 -0
- data/lib/numbers_and_words/i18n/pluralization.rb +3 -1
- data/lib/numbers_and_words/i18n/plurals/cs.rb +15 -10
- data/lib/numbers_and_words/i18n/plurals/fr.rb +5 -3
- data/lib/numbers_and_words/i18n/plurals/lt.rb +10 -7
- data/lib/numbers_and_words/i18n/plurals/lv.rb +5 -3
- data/lib/numbers_and_words/i18n/plurals/plurals.rb +2 -0
- data/lib/numbers_and_words/i18n/plurals/ru.rb +15 -10
- data/lib/numbers_and_words/i18n/plurals/ua.rb +2 -0
- data/lib/numbers_and_words/strategies.rb +2 -0
- data/lib/numbers_and_words/strategies/array_joiner.rb +2 -0
- data/lib/numbers_and_words/strategies/array_joiner/languages.rb +3 -0
- data/lib/numbers_and_words/strategies/array_joiner/languages/base.rb +2 -0
- data/lib/numbers_and_words/strategies/array_joiner/languages/cs.rb +2 -0
- data/lib/numbers_and_words/strategies/array_joiner/languages/en-GB.rb +3 -1
- data/lib/numbers_and_words/strategies/array_joiner/languages/en.rb +2 -0
- data/lib/numbers_and_words/strategies/array_joiner/languages/es.rb +2 -0
- data/lib/numbers_and_words/strategies/array_joiner/languages/families/base.rb +5 -3
- data/lib/numbers_and_words/strategies/array_joiner/languages/fr.rb +2 -0
- data/lib/numbers_and_words/strategies/array_joiner/languages/hu.rb +2 -0
- data/lib/numbers_and_words/strategies/array_joiner/languages/pt-BR.rb +2 -0
- data/lib/numbers_and_words/strategies/array_joiner/languages/ru.rb +2 -0
- data/lib/numbers_and_words/strategies/array_joiner/languages/ua.rb +2 -0
- data/lib/numbers_and_words/strategies/array_joiner/languages/vi.rb +12 -0
- data/lib/numbers_and_words/strategies/figures_converter.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators.rb +3 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/base.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/cs.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/cs/base.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/cs/fractional.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/cs/integral.rb +3 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en-GB.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en-GB/base.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en-GB/fractional.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en-GB/integral.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en/base.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en/integral.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/es.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/es/base.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/es/fractional.rb +3 -1
- data/lib/numbers_and_words/strategies/figures_converter/decorators/es/integral.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/fr.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/fr/base.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/fr/fractional.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/fr/integral.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/hu.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/base.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/fractional.rb +3 -1
- data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/integral.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/pt-BR.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/pt-BR/base.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/pt-BR/fractional.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/pt-BR/integral.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ru.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/base.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/fractional.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/integral.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ua.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/base.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/fractional.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/integral.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/vi.rb +5 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/vi/base.rb +14 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/vi/fractional.rb +14 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/vi/integral.rb +14 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages.rb +14 -15
- data/lib/numbers_and_words/strategies/figures_converter/languages/base.rb +4 -2
- data/lib/numbers_and_words/strategies/figures_converter/languages/cs.rb +4 -4
- data/lib/numbers_and_words/strategies/figures_converter/languages/de.rb +7 -7
- data/lib/numbers_and_words/strategies/figures_converter/languages/en-GB.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/en.rb +3 -9
- data/lib/numbers_and_words/strategies/figures_converter/languages/es.rb +11 -13
- data/lib/numbers_and_words/strategies/figures_converter/languages/et.rb +2 -2
- data/lib/numbers_and_words/strategies/figures_converter/languages/families/base.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/families/cyrillic.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/families/helpers.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/fr.rb +12 -12
- data/lib/numbers_and_words/strategies/figures_converter/languages/hu.rb +2 -2
- data/lib/numbers_and_words/strategies/figures_converter/languages/{families/latin.rb → hy.rb} +3 -4
- data/lib/numbers_and_words/strategies/figures_converter/languages/it.rb +2 -1
- data/lib/numbers_and_words/strategies/figures_converter/languages/ka.rb +13 -15
- data/lib/numbers_and_words/strategies/figures_converter/languages/lt.rb +8 -12
- data/lib/numbers_and_words/strategies/figures_converter/languages/lv.rb +4 -14
- data/lib/numbers_and_words/strategies/figures_converter/languages/nl.rb +3 -5
- data/lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb +14 -12
- data/lib/numbers_and_words/strategies/figures_converter/languages/pt.rb +3 -3
- data/lib/numbers_and_words/strategies/figures_converter/languages/ru.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/se.rb +2 -1
- data/lib/numbers_and_words/strategies/figures_converter/languages/tr.rb +4 -4
- data/lib/numbers_and_words/strategies/figures_converter/languages/ua.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/vi.rb +100 -0
- data/lib/numbers_and_words/strategies/figures_converter/options.rb +15 -2
- data/lib/numbers_and_words/strategies/figures_converter/options/base.rb +5 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/base/gender.rb +30 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/base/ordinal.rb +28 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/base/remove_zero.rb +30 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/cs.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/cs/gender.rb +3 -14
- data/lib/numbers_and_words/strategies/figures_converter/options/cs/ordinal.rb +3 -15
- data/lib/numbers_and_words/strategies/figures_converter/options/cs/remove_zero.rb +3 -17
- data/lib/numbers_and_words/strategies/figures_converter/options/en-GB.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/hundreds_with_union.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/ordinal.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/pronounced.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/remove_hyphen.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/remove_zero.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en/hundreds_with_union.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb +3 -10
- data/lib/numbers_and_words/strategies/figures_converter/options/en/pronounced.rb +6 -13
- data/lib/numbers_and_words/strategies/figures_converter/options/en/remove_hyphen.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en/remove_zero.rb +3 -17
- data/lib/numbers_and_words/strategies/figures_converter/options/es.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/es/apocopated.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/es/gender.rb +3 -17
- data/lib/numbers_and_words/strategies/figures_converter/options/es/remove_zero.rb +3 -17
- data/lib/numbers_and_words/strategies/figures_converter/options/hu.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/hu/ordinal.rb +3 -50
- data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR/gender.rb +3 -18
- data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR/ordinal.rb +3 -15
- data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR/remove_zero.rb +3 -17
- data/lib/numbers_and_words/strategies/figures_converter/options/ru.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/ru/gender.rb +3 -17
- data/lib/numbers_and_words/strategies/figures_converter/options/ua.rb +2 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/ua/gender.rb +3 -17
- data/lib/numbers_and_words/translations.rb +4 -0
- data/lib/numbers_and_words/translations/base.rb +3 -1
- data/lib/numbers_and_words/translations/cs.rb +6 -31
- data/lib/numbers_and_words/translations/de.rb +5 -3
- data/lib/numbers_and_words/translations/en-GB.rb +5 -1
- data/lib/numbers_and_words/translations/en.rb +2 -0
- data/lib/numbers_and_words/translations/es.rb +15 -25
- data/lib/numbers_and_words/translations/et.rb +4 -7
- data/lib/numbers_and_words/translations/extensions/fraction_significance.rb +6 -4
- data/lib/numbers_and_words/translations/families/base.rb +5 -3
- data/lib/numbers_and_words/translations/families/cyrillic.rb +6 -8
- data/lib/numbers_and_words/translations/families/latin.rb +2 -0
- data/lib/numbers_and_words/translations/fr.rb +15 -18
- data/lib/numbers_and_words/translations/hu.rb +4 -7
- data/lib/numbers_and_words/translations/hy.rb +21 -0
- data/lib/numbers_and_words/translations/it.rb +2 -0
- data/lib/numbers_and_words/translations/ka.rb +6 -14
- data/lib/numbers_and_words/translations/lt.rb +4 -11
- data/lib/numbers_and_words/translations/lv.rb +4 -11
- data/lib/numbers_and_words/translations/nl.rb +6 -2
- data/lib/numbers_and_words/translations/pt-BR.rb +23 -23
- data/lib/numbers_and_words/translations/pt.rb +5 -11
- data/lib/numbers_and_words/translations/ru.rb +2 -17
- data/lib/numbers_and_words/translations/se.rb +2 -0
- data/lib/numbers_and_words/translations/tr.rb +2 -4
- data/lib/numbers_and_words/translations/ua.rb +2 -13
- data/lib/numbers_and_words/translations/vi.rb +24 -0
- data/lib/numbers_and_words/version.rb +3 -1
- data/lib/numbers_and_words/wrappers.rb +2 -0
- data/lib/numbers_and_words/wrappers/float.rb +3 -1
- data/lib/numbers_and_words/wrappers/integer.rb +2 -0
- metadata +33 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 84a1dae35d34a880f4a6d6509abb36912c5746f43164489a370343e8b06930d3
|
4
|
+
data.tar.gz: e6384d6eeb6b96268e0185a84db8707a86b6ca5508aebcbda2157231c710e644
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c030f45f26b1d578943e9588ab2917fd8d17f07a6351f44133979f39e8a4f8aac71012ab5411aff89ac11105a86689fc3518622038fadc3866d093762ad4fe4e
|
7
|
+
data.tar.gz: c02be4c6e859336bd71df3b23bacfc36fc9738aad8b4f1182b02fc50a1c075c83307e5e8ddc6564de0839e5690f82414ab9e064686f312590c9da98b217cd159
|
data/README.rdoc
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
== numbers_and_words
|
2
2
|
|
3
3
|
{<img src="https://badge.fury.io/rb/numbers_and_words.svg?branch=master" alt="Gem Version" />}[http://badge.fury.io/rb/numbers_and_words]
|
4
|
-
{<img src="https://gemnasium.com/kslazarev/numbers_and_words.svg?branch=master" alt="Dependency Status" />}[https://gemnasium.com/kslazarev/numbers_and_words]
|
5
4
|
{<img src="https://codeclimate.com/github/kslazarev/numbers_and_words.svg?branch=master" />}[https://codeclimate.com/github/kslazarev/numbers_and_words]
|
6
5
|
{<img src="https://secure.travis-ci.org/kslazarev/numbers_and_words.svg?branch=master" />}[http://travis-ci.org/kslazarev/numbers_and_words]
|
7
6
|
{<img src="https://coveralls.io/repos/kslazarev/numbers_and_words/badge.svg?branch=master" alt="Coverage Status" />}[https://coveralls.io/r/kslazarev/numbers_and_words]
|
8
7
|
|
9
|
-
|
8
|
+
Spell out numbers in several languages using the I18n gem.
|
10
9
|
|
11
10
|
Перевод чисел в слова при помощи библиотеки I18n.
|
12
11
|
|
@@ -16,7 +15,7 @@ Számok betűvel írva az I18n könyvtár segítségével.
|
|
16
15
|
|
17
16
|
I18n kütüphanesi ile sayıları yazıya çevirir.
|
18
17
|
|
19
|
-
|
18
|
+
Soletra números em vários idiomas utilizando a biblioteca I18n.
|
20
19
|
|
21
20
|
== Supported Languages / Языки / Langues Supportées
|
22
21
|
|
@@ -39,6 +38,7 @@ Converte números em letras utilizando a biblioteca I18n.
|
|
39
38
|
* Česky [cs]
|
40
39
|
* Português [pt]
|
41
40
|
* Português Brasileiro [pt-BR]
|
41
|
+
* հայերեն (Armenian) [hy]
|
42
42
|
|
43
43
|
** Experimental
|
44
44
|
|
@@ -82,6 +82,12 @@ Converte números em letras utilizando a biblioteca I18n.
|
|
82
82
|
I18n.with_locale(:cs) { 42.to_words }
|
83
83
|
=> "čtyřicetdva"
|
84
84
|
|
85
|
+
I18n.with_locale(:vi) { 42.to_words }
|
86
|
+
=> "bốn mươi hai"
|
87
|
+
|
88
|
+
I18n.with_locale(:hy) { 42.to_words }
|
89
|
+
=> "քառասուն երկու"
|
90
|
+
|
85
91
|
21.to_words
|
86
92
|
=> "twenty-one"
|
87
93
|
=> "veintiuno"
|
@@ -100,6 +106,8 @@ Converte números em letras utilizando a biblioteca I18n.
|
|
100
106
|
=> "tjugo-en"
|
101
107
|
=> "dvacetjedna"
|
102
108
|
=> "vinte e um"
|
109
|
+
=> "hai mươi mốt"
|
110
|
+
=> "քսան մեկ"
|
103
111
|
|
104
112
|
231.to_words
|
105
113
|
=> "two hundred thirty-one"
|
@@ -119,6 +127,8 @@ Converte números em letras utilizando a biblioteca I18n.
|
|
119
127
|
=> "två hundra trettio-en"
|
120
128
|
=> "dvě stě třicetjedna"
|
121
129
|
=> "duzentos e trinta e um"
|
130
|
+
=> "hai trăm ba mươi mốt"
|
131
|
+
=> "երկու հարյուր երեսուն մեկ"
|
122
132
|
|
123
133
|
4030.to_words
|
124
134
|
=> "four thousand thirty"
|
@@ -137,6 +147,8 @@ Converte números em letras utilizando a biblioteca I18n.
|
|
137
147
|
=> "vierthousanddertig"
|
138
148
|
=> "fyra tusen trettio"
|
139
149
|
=> "čtyři tisíce třicet"
|
150
|
+
=> "bốn nghìn không trăm ba mươi"
|
151
|
+
=> "չորս հազար երեսուն"
|
140
152
|
|
141
153
|
1000100.to_words
|
142
154
|
=> "one million one hundred"
|
@@ -155,6 +167,8 @@ Converte números em letras utilizando a biblioteca I18n.
|
|
155
167
|
=> "één miljoen honderd"
|
156
168
|
=> "en miljoner en hundra"
|
157
169
|
=> "jeden milión jedno sto"
|
170
|
+
=> "một triệu một trăm"
|
171
|
+
=> "մեկ միլիոն հարյուր"
|
158
172
|
|
159
173
|
1000000000000000000000000000000000.to_words
|
160
174
|
=> "one decillion"
|
@@ -184,6 +198,8 @@ Converte números em letras utilizando a biblioteca I18n.
|
|
184
198
|
=> ["üks", "kaks", "kolm"]
|
185
199
|
=> ["ერთი", "ორი", "სამი"]
|
186
200
|
=> ["jedna", "dva", "tři"]
|
201
|
+
=> ["một", "hai", "ba"]
|
202
|
+
=> ["մեկ", "երկու", "երեք"]
|
187
203
|
|
188
204
|
[11, 22, 133].to_words
|
189
205
|
=> ["eleven", "twenty-two", "one hundred thirty-three"]
|
@@ -202,6 +218,8 @@ Converte números em letras utilizando a biblioteca I18n.
|
|
202
218
|
=> ["elf", "tweeentwintig", "honderddrieendertig"]
|
203
219
|
=> ["elva", "tjugo-två", "en hundra trettio-tre"]
|
204
220
|
=> ["jedenáct", "dvacetdva", "jedno sto třicettři"]
|
221
|
+
=> ["mười một", "hai mươi hai", "một trăm ba mươi ba"]
|
222
|
+
=> ["տասնմեկ", "քսան երկու", "հարյուր երեսուն երեք"]
|
205
223
|
|
206
224
|
21.77.to_words
|
207
225
|
=> "twenty-one and seventy-seven hundredths"
|
@@ -209,6 +227,7 @@ Converte números em letras utilizando a biblioteca I18n.
|
|
209
227
|
=> "двадцять одна цiла i сiмдесят сiм сотих"
|
210
228
|
=> "huszonegy egész hetvenhét század"
|
211
229
|
=> "twenty-one point seven seven"
|
230
|
+
=> "hai mươi mốt phẩy bảy mươi bảy"
|
212
231
|
|
213
232
|
== Language options / Языковые опции
|
214
233
|
|
@@ -306,8 +325,7 @@ Converte números em letras utilizando a biblioteca I18n.
|
|
306
325
|
|
307
326
|
== Requirements / Требования / Configuration Requise
|
308
327
|
|
309
|
-
*
|
310
|
-
* 1.8.7 <= Ruby <= 1.9.2 (-v 0.9.0)
|
328
|
+
* 2.5 <= Ruby (compatible with/совместимость с/compatible avec Ruby 2.5 and/и/et JRuby);
|
311
329
|
* 0.5.0 <= I18n (earlier versions not tested/ранние версии не тестировались/versions précédentes non testées);
|
312
330
|
|
313
331
|
== Installation / Установка / Installation
|
data/lib/numbers_and_words.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module NumbersAndWords
|
2
4
|
module ArrayExtensions
|
3
5
|
module Helpers
|
@@ -37,7 +39,7 @@ module NumbersAndWords
|
|
37
39
|
end
|
38
40
|
|
39
41
|
def ones
|
40
|
-
self[0].to_i if self[0].to_i
|
42
|
+
self[0].to_i if self[0].to_i.positive?
|
41
43
|
end
|
42
44
|
|
43
45
|
def teens
|
@@ -45,7 +47,7 @@ module NumbersAndWords
|
|
45
47
|
end
|
46
48
|
|
47
49
|
def tens
|
48
|
-
self[1].to_i if self[1]
|
50
|
+
self[1].to_i if self[1].to_i.positive?
|
49
51
|
end
|
50
52
|
|
51
53
|
def tens_with_ones
|
@@ -53,7 +55,7 @@ module NumbersAndWords
|
|
53
55
|
end
|
54
56
|
|
55
57
|
def hundreds
|
56
|
-
self[2].to_i if self[2].to_i
|
58
|
+
self[2].to_i if self[2].to_i.positive?
|
57
59
|
end
|
58
60
|
|
59
61
|
def round_hundred?
|
@@ -77,7 +79,7 @@ module NumbersAndWords
|
|
77
79
|
end
|
78
80
|
|
79
81
|
def ordinal_index
|
80
|
-
index
|
82
|
+
index(&:positive?)
|
81
83
|
end
|
82
84
|
|
83
85
|
def ordinal_capacity
|
@@ -1,22 +1,13 @@
|
|
1
1
|
cs:
|
2
2
|
numbers:
|
3
|
-
union: ''
|
4
|
-
union_separator: ''
|
5
|
-
integral: celých
|
6
3
|
ones:
|
7
4
|
male: [nula, jeden, dva, tři, čtyři, pět, šest, sedm, osm, devět]
|
8
5
|
female: [nula, jedna, dvě, tři, čtyři, pět, šest, sedm, osm, devět]
|
9
6
|
neuter: [nula, jedno, dvě, tři, čtyři, pět, šest, sedm, osm, devět]
|
10
|
-
teens: [
|
7
|
+
teens: [_, jedenáct, dvanáct, třináct, čtrnáct, patnáct, šestnáct, sedmnáct, osmnáct, devatenáct]
|
11
8
|
tens: [_, deset, dvacet, třicet, čtyřicet, padesát, šedesát, sedmdesát, osmdesát, devadesát]
|
12
9
|
hundreds: [_, jedno sto, dvě stě, tři sta, čtyři sta, pět set, šest set, sedm set, osm set, devět set]
|
13
|
-
|
14
|
-
# mega: [ones, thousands, miliony, miliardy, biliony, biliardy, triliony, triliardy, quadriliony, quadriliardy]
|
15
|
-
micro:
|
16
|
-
one: [_, desetina, setina, tisícina, milióntina, miliardtina, bilióntina]
|
17
|
-
few: [_, desetiny, setiny, tisíciny, milióntiny, miliardtiny, bilióntiny]
|
18
|
-
many: [_, desetin, setin, tisícin, milióntin, miliardtin, bilióntin]
|
19
|
-
sub_micro: [_, deseti, sto]
|
10
|
+
mega: [_, thousands, millions, billions, trillions, quadrillions, quintillions, sextillions, septillions, octillions]
|
20
11
|
thousands:
|
21
12
|
one: tisíc
|
22
13
|
few: tisíce
|
@@ -53,26 +44,15 @@ cs:
|
|
53
44
|
one: kvadriliarda
|
54
45
|
few: kvadriliardy
|
55
46
|
many: kvadriliard
|
56
|
-
mega:
|
57
|
-
- ones
|
58
|
-
- thousands
|
59
|
-
- millions
|
60
|
-
- billions
|
61
|
-
- trillions
|
62
|
-
- quadrillions
|
63
|
-
- quintillion
|
64
|
-
- sextillions
|
65
|
-
- septillions
|
66
|
-
- octillions
|
67
47
|
ordinal:
|
68
48
|
ones:
|
69
49
|
male: [nultý, první, druhý, třetí, čtvrtý, pátý, šestý, sedmý, osmý, devátý]
|
70
50
|
female: [nultá, první, druhá, třetí, čtvrtá, pátá, šestá, sedmá, osmá, devátá]
|
71
51
|
neuter: [nulté, první, druhé, třetí, čtvrté, páté, šesté, sedmé, osmé, deváté]
|
72
52
|
teens:
|
73
|
-
male: [
|
74
|
-
female: [
|
75
|
-
neuter: [
|
53
|
+
male: [_, jedenáctý, dvanáctý, třináctý, čtrnáctý, patnáctý, šestnáctý, sedmnáctý, osmnáctý, devatenáctý]
|
54
|
+
female: [_, jedenáctá, dvanáctá, třináctá, čtrnáctá, patnáctá, šestnáctá, sedmnáctá, osmnáctá, devatenáctá]
|
55
|
+
neuter: [_, jedenácté, dvanácté, třinácté, čtrnácté, patnácté, šestnácté, sedmnácté, osmnácté, devatenácté]
|
76
56
|
tens:
|
77
57
|
male: [_, desátý, dvacátý, třicátý, čtyřicátý, padesátý, šedesátý, sedmdesátý, osmdesátý, devadesátý]
|
78
58
|
female: [_, desátá, dvacátá, třicátá, čtyřicátá, padesátá, šedesátá, sedmdesátá, osmdesátá, devadesátá]
|
@@ -81,4 +61,35 @@ cs:
|
|
81
61
|
male: [_, stý, dvoustý, třístý, čtyřstý, pětistý, šestistý, sedmistý, osmistý, devítistý]
|
82
62
|
female: [_, stá, dvoustá, třístá, čtyřstá, pětistá, šestistá, sedmistá, osmistá, devítistá]
|
83
63
|
neuter: [_, sté, dvousté, třísté, čtyřsté, pětisté, šestisté, sedmisté, osmisté, devítisté]
|
84
|
-
|
64
|
+
integral: celých
|
65
|
+
micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths]
|
66
|
+
tenths:
|
67
|
+
one: desetina
|
68
|
+
few: desetiny
|
69
|
+
many: desetin
|
70
|
+
hundredths:
|
71
|
+
one: setina
|
72
|
+
few: setiny
|
73
|
+
many: setin
|
74
|
+
thousandths:
|
75
|
+
one: tisícina
|
76
|
+
few: tisíciny
|
77
|
+
many: tisícin
|
78
|
+
millionths:
|
79
|
+
one: milióntina
|
80
|
+
few: milióntiny
|
81
|
+
many: milióntin
|
82
|
+
billionths:
|
83
|
+
one: miliardtina
|
84
|
+
few: miliardtiny
|
85
|
+
many: miliardtin
|
86
|
+
trillionths:
|
87
|
+
one: bilióntina
|
88
|
+
few: bilióntiny
|
89
|
+
many: bilióntin
|
90
|
+
micro_separator: ''
|
91
|
+
micro_prefix:
|
92
|
+
tens: deseti
|
93
|
+
hundreds: sto
|
94
|
+
union: ''
|
95
|
+
union: ''
|
@@ -4,10 +4,10 @@ de:
|
|
4
4
|
default: ['null', eins, zwei, drei, vier, fünf, sechs, sieben, acht, neun]
|
5
5
|
combine: ['null', ein, zwei, drei, vier, fünf, sechs, sieben, acht, neun]
|
6
6
|
gender: ['null', eine, zwei, drei, vier, fünf, sechs, sieben, acht, neun]
|
7
|
-
teens: [
|
8
|
-
tens: [
|
9
|
-
mega: [ones, thousands, millions, billions, trillions, quadrillions, quintillion, sextillions, septillions, octillions, nonillions, decillions]
|
7
|
+
teens: [_, elf, zwölf, dreizehn, vierzehn, fünfzehn, sechzehn, siebzehn, achtzehn, neunzehn]
|
8
|
+
tens: [_, zehn, zwanzig, dreißig, vierzig, fünfzig, sechzig, siebzig, achtzig, neunzig]
|
10
9
|
hundreds: hundert
|
10
|
+
mega: [_, thousands, millions, billions, trillions, quadrillions, quintillion, sextillions, septillions, octillions, nonillions, decillions]
|
11
11
|
thousands:
|
12
12
|
one: tausend
|
13
13
|
other: tausend
|
@@ -40,4 +40,5 @@ de:
|
|
40
40
|
other: Quintillionen
|
41
41
|
decillions:
|
42
42
|
one: Quintilliarde
|
43
|
-
other: Quintilliarden
|
43
|
+
other: Quintilliarden
|
44
|
+
union: und
|
@@ -1,18 +1,17 @@
|
|
1
1
|
en-GB:
|
2
2
|
numbers:
|
3
3
|
ones: [zero, one, two, three, four, five, six, seven, eight, nine]
|
4
|
-
teens: [
|
5
|
-
tens: [
|
4
|
+
teens: [_, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen]
|
5
|
+
tens: [_, ten, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety]
|
6
6
|
hundreds: hundred
|
7
|
-
mega: [
|
7
|
+
mega: [_, thousand, million, billion, trillion, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion, undecillion, duodecillion, tredecillion, quattuordecillion]
|
8
8
|
ordinal:
|
9
9
|
ones: [zeroth, first, second, third, fourth, fifth, sixth, seventh, eighth, ninth]
|
10
10
|
teens: [tenth, eleventh, twelfth, thirteenth, fourteenth, fifteenth, sixteenth, seventeenth, eighteenth, nineteenth]
|
11
|
-
tens: [
|
11
|
+
tens: [_, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth]
|
12
12
|
hundreds: hundredth
|
13
|
-
mega: [
|
14
|
-
|
15
|
-
micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths]
|
13
|
+
mega: [_, thousandth, millionth, billionth, trillionth, quadrillionth, quintillionth, sextillionth, septillionth, octillionth, nonillionth, decillionth, undecillionth, duodecillionth, tredecillionth, quattuordecillionth]
|
14
|
+
micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths, undecillionths, duodecillionths, tredecillionths, quattuordecillionths]
|
16
15
|
tenths:
|
17
16
|
one: tenth
|
18
17
|
other: tenths
|
@@ -52,4 +51,21 @@ en-GB:
|
|
52
51
|
decillionths:
|
53
52
|
one: decillionth
|
54
53
|
other: decillionths
|
55
|
-
|
54
|
+
undecillionths:
|
55
|
+
one: undecillionth
|
56
|
+
other: undecillionths
|
57
|
+
duodecillionths:
|
58
|
+
one: duodecillionth
|
59
|
+
other: duodecillionths
|
60
|
+
tredecillionths:
|
61
|
+
one: tredecillionth
|
62
|
+
other: tredecillionths
|
63
|
+
quattuordecillionths:
|
64
|
+
one: quattuordecillionth
|
65
|
+
other: quattuordecillionths
|
66
|
+
micro_separator: point
|
67
|
+
micro_prefix:
|
68
|
+
tens: ten
|
69
|
+
hundreds: hundred
|
70
|
+
union: '-'
|
71
|
+
union: and
|
@@ -1,17 +1,16 @@
|
|
1
1
|
en:
|
2
2
|
numbers:
|
3
3
|
ones: [zero, one, two, three, four, five, six, seven, eight, nine]
|
4
|
-
teens: [
|
5
|
-
tens: [
|
4
|
+
teens: [_, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen]
|
5
|
+
tens: [_, ten, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety]
|
6
6
|
hundreds: hundred
|
7
|
-
mega: [
|
7
|
+
mega: [_, thousand, million, billion, trillion, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion, undecillion, duodecillion, tredecillion, quattuordecillion]
|
8
8
|
ordinal:
|
9
9
|
ones: [zeroth, first, second, third, fourth, fifth, sixth, seventh, eighth, ninth]
|
10
10
|
teens: [tenth, eleventh, twelfth, thirteenth, fourteenth, fifteenth, sixteenth, seventeenth, eighteenth, nineteenth]
|
11
|
-
tens: [
|
11
|
+
tens: [_, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth]
|
12
12
|
hundreds: hundredth
|
13
|
-
mega: [
|
14
|
-
union_separator: and
|
13
|
+
mega: [_, thousandth, millionth, billionth, trillionth, quadrillionth, quintillionth, sextillionth, septillionth, octillionth, nonillionth, decillionth, undecillionth, duodecillionth, tredecillionth, quattuordecillionth]
|
15
14
|
micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths, undecillionths, duodecillionths, tredecillionths, quattuordecillionths]
|
16
15
|
tenths:
|
17
16
|
one: tenth
|
@@ -64,4 +63,9 @@ en:
|
|
64
63
|
quattuordecillionths:
|
65
64
|
one: quattuordecillionth
|
66
65
|
other: quattuordecillionths
|
66
|
+
micro_separator: and
|
67
|
+
micro_prefix:
|
68
|
+
tens: ten
|
69
|
+
hundreds: hundred
|
70
|
+
union: '-'
|
67
71
|
union: and
|
@@ -44,11 +44,7 @@ es:
|
|
44
44
|
one: septillón
|
45
45
|
other: septillones
|
46
46
|
quattuordecillions: mil septillones
|
47
|
-
union: y
|
48
47
|
micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths, undecillionths, duodecillionths, tredecillionths, quattuordecillionths]
|
49
|
-
micro_prefix:
|
50
|
-
tens: diez
|
51
|
-
hundreds: cien
|
52
48
|
tenths:
|
53
49
|
one: décima
|
54
50
|
other: décimas
|
@@ -100,4 +96,9 @@ es:
|
|
100
96
|
quattuordecillionths:
|
101
97
|
one: milseptillonésima
|
102
98
|
other: milseptillonésimas
|
103
|
-
|
99
|
+
micro_separator: con
|
100
|
+
micro_prefix:
|
101
|
+
tens: diez
|
102
|
+
hundreds: cien
|
103
|
+
union: ''
|
104
|
+
union: y
|