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.
Files changed (193) hide show
  1. checksums.yaml +5 -5
  2. data/README.rdoc +23 -5
  3. data/lib/numbers_and_words.rb +2 -0
  4. data/lib/numbers_and_words/core_ext.rb +2 -0
  5. data/lib/numbers_and_words/core_ext/array.rb +2 -0
  6. data/lib/numbers_and_words/core_ext/float.rb +2 -0
  7. data/lib/numbers_and_words/core_ext/integer.rb +2 -0
  8. data/lib/numbers_and_words/helper_classes.rb +2 -0
  9. data/lib/numbers_and_words/helper_classes/array_extensions/helpers.rb +6 -4
  10. data/lib/numbers_and_words/helper_classes/figures_array.rb +2 -0
  11. data/lib/numbers_and_words/helper_classes/words_array.rb +2 -0
  12. data/lib/numbers_and_words/i18n.rb +2 -0
  13. data/lib/numbers_and_words/i18n/initialization.rb +2 -0
  14. data/lib/numbers_and_words/i18n/locales/numbers.cs.yml +37 -26
  15. data/lib/numbers_and_words/i18n/locales/numbers.de.yml +5 -4
  16. data/lib/numbers_and_words/i18n/locales/numbers.en-GB.yml +24 -8
  17. data/lib/numbers_and_words/i18n/locales/numbers.en.yml +10 -6
  18. data/lib/numbers_and_words/i18n/locales/numbers.es.yml +6 -5
  19. data/lib/numbers_and_words/i18n/locales/numbers.et.yml +4 -4
  20. data/lib/numbers_and_words/i18n/locales/numbers.fr.yml +45 -41
  21. data/lib/numbers_and_words/i18n/locales/numbers.hu.yml +11 -7
  22. data/lib/numbers_and_words/i18n/locales/numbers.hy.yml +7 -0
  23. data/lib/numbers_and_words/i18n/locales/numbers.it.yml +3 -3
  24. data/lib/numbers_and_words/i18n/locales/numbers.ka.yml +6 -14
  25. data/lib/numbers_and_words/i18n/locales/numbers.lt.yml +4 -5
  26. data/lib/numbers_and_words/i18n/locales/numbers.lv.yml +4 -5
  27. data/lib/numbers_and_words/i18n/locales/numbers.nl.yml +4 -3
  28. data/lib/numbers_and_words/i18n/locales/numbers.pt-BR.yml +51 -22
  29. data/lib/numbers_and_words/i18n/locales/numbers.pt.yml +21 -8
  30. data/lib/numbers_and_words/i18n/locales/numbers.ru.yml +39 -27
  31. data/lib/numbers_and_words/i18n/locales/numbers.se.yml +3 -3
  32. data/lib/numbers_and_words/i18n/locales/numbers.tr.yml +3 -3
  33. data/lib/numbers_and_words/i18n/locales/numbers.ua.yml +39 -15
  34. data/lib/numbers_and_words/i18n/locales/numbers.vi.yml +13 -0
  35. data/lib/numbers_and_words/i18n/pluralization.rb +3 -1
  36. data/lib/numbers_and_words/i18n/plurals/cs.rb +15 -10
  37. data/lib/numbers_and_words/i18n/plurals/fr.rb +5 -3
  38. data/lib/numbers_and_words/i18n/plurals/lt.rb +10 -7
  39. data/lib/numbers_and_words/i18n/plurals/lv.rb +5 -3
  40. data/lib/numbers_and_words/i18n/plurals/plurals.rb +2 -0
  41. data/lib/numbers_and_words/i18n/plurals/ru.rb +15 -10
  42. data/lib/numbers_and_words/i18n/plurals/ua.rb +2 -0
  43. data/lib/numbers_and_words/strategies.rb +2 -0
  44. data/lib/numbers_and_words/strategies/array_joiner.rb +2 -0
  45. data/lib/numbers_and_words/strategies/array_joiner/languages.rb +3 -0
  46. data/lib/numbers_and_words/strategies/array_joiner/languages/base.rb +2 -0
  47. data/lib/numbers_and_words/strategies/array_joiner/languages/cs.rb +2 -0
  48. data/lib/numbers_and_words/strategies/array_joiner/languages/en-GB.rb +3 -1
  49. data/lib/numbers_and_words/strategies/array_joiner/languages/en.rb +2 -0
  50. data/lib/numbers_and_words/strategies/array_joiner/languages/es.rb +2 -0
  51. data/lib/numbers_and_words/strategies/array_joiner/languages/families/base.rb +5 -3
  52. data/lib/numbers_and_words/strategies/array_joiner/languages/fr.rb +2 -0
  53. data/lib/numbers_and_words/strategies/array_joiner/languages/hu.rb +2 -0
  54. data/lib/numbers_and_words/strategies/array_joiner/languages/pt-BR.rb +2 -0
  55. data/lib/numbers_and_words/strategies/array_joiner/languages/ru.rb +2 -0
  56. data/lib/numbers_and_words/strategies/array_joiner/languages/ua.rb +2 -0
  57. data/lib/numbers_and_words/strategies/array_joiner/languages/vi.rb +12 -0
  58. data/lib/numbers_and_words/strategies/figures_converter.rb +2 -0
  59. data/lib/numbers_and_words/strategies/figures_converter/decorators.rb +3 -0
  60. data/lib/numbers_and_words/strategies/figures_converter/decorators/base.rb +2 -0
  61. data/lib/numbers_and_words/strategies/figures_converter/decorators/cs.rb +2 -0
  62. data/lib/numbers_and_words/strategies/figures_converter/decorators/cs/base.rb +2 -0
  63. data/lib/numbers_and_words/strategies/figures_converter/decorators/cs/fractional.rb +2 -0
  64. data/lib/numbers_and_words/strategies/figures_converter/decorators/cs/integral.rb +3 -0
  65. data/lib/numbers_and_words/strategies/figures_converter/decorators/en-GB.rb +2 -0
  66. data/lib/numbers_and_words/strategies/figures_converter/decorators/en-GB/base.rb +2 -0
  67. data/lib/numbers_and_words/strategies/figures_converter/decorators/en-GB/fractional.rb +2 -0
  68. data/lib/numbers_and_words/strategies/figures_converter/decorators/en-GB/integral.rb +2 -0
  69. data/lib/numbers_and_words/strategies/figures_converter/decorators/en.rb +2 -0
  70. data/lib/numbers_and_words/strategies/figures_converter/decorators/en/base.rb +2 -0
  71. data/lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb +2 -0
  72. data/lib/numbers_and_words/strategies/figures_converter/decorators/en/integral.rb +2 -0
  73. data/lib/numbers_and_words/strategies/figures_converter/decorators/es.rb +2 -0
  74. data/lib/numbers_and_words/strategies/figures_converter/decorators/es/base.rb +2 -0
  75. data/lib/numbers_and_words/strategies/figures_converter/decorators/es/fractional.rb +3 -1
  76. data/lib/numbers_and_words/strategies/figures_converter/decorators/es/integral.rb +2 -0
  77. data/lib/numbers_and_words/strategies/figures_converter/decorators/fr.rb +2 -0
  78. data/lib/numbers_and_words/strategies/figures_converter/decorators/fr/base.rb +2 -0
  79. data/lib/numbers_and_words/strategies/figures_converter/decorators/fr/fractional.rb +2 -0
  80. data/lib/numbers_and_words/strategies/figures_converter/decorators/fr/integral.rb +2 -0
  81. data/lib/numbers_and_words/strategies/figures_converter/decorators/hu.rb +2 -0
  82. data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/base.rb +2 -0
  83. data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/fractional.rb +3 -1
  84. data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/integral.rb +2 -0
  85. data/lib/numbers_and_words/strategies/figures_converter/decorators/pt-BR.rb +2 -0
  86. data/lib/numbers_and_words/strategies/figures_converter/decorators/pt-BR/base.rb +2 -0
  87. data/lib/numbers_and_words/strategies/figures_converter/decorators/pt-BR/fractional.rb +2 -0
  88. data/lib/numbers_and_words/strategies/figures_converter/decorators/pt-BR/integral.rb +2 -0
  89. data/lib/numbers_and_words/strategies/figures_converter/decorators/ru.rb +2 -0
  90. data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/base.rb +2 -0
  91. data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/fractional.rb +2 -0
  92. data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/integral.rb +2 -0
  93. data/lib/numbers_and_words/strategies/figures_converter/decorators/ua.rb +2 -0
  94. data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/base.rb +2 -0
  95. data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/fractional.rb +2 -0
  96. data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/integral.rb +2 -0
  97. data/lib/numbers_and_words/strategies/figures_converter/decorators/vi.rb +5 -0
  98. data/lib/numbers_and_words/strategies/figures_converter/decorators/vi/base.rb +14 -0
  99. data/lib/numbers_and_words/strategies/figures_converter/decorators/vi/fractional.rb +14 -0
  100. data/lib/numbers_and_words/strategies/figures_converter/decorators/vi/integral.rb +14 -0
  101. data/lib/numbers_and_words/strategies/figures_converter/languages.rb +14 -15
  102. data/lib/numbers_and_words/strategies/figures_converter/languages/base.rb +4 -2
  103. data/lib/numbers_and_words/strategies/figures_converter/languages/cs.rb +4 -4
  104. data/lib/numbers_and_words/strategies/figures_converter/languages/de.rb +7 -7
  105. data/lib/numbers_and_words/strategies/figures_converter/languages/en-GB.rb +2 -0
  106. data/lib/numbers_and_words/strategies/figures_converter/languages/en.rb +3 -9
  107. data/lib/numbers_and_words/strategies/figures_converter/languages/es.rb +11 -13
  108. data/lib/numbers_and_words/strategies/figures_converter/languages/et.rb +2 -2
  109. data/lib/numbers_and_words/strategies/figures_converter/languages/families/base.rb +2 -0
  110. data/lib/numbers_and_words/strategies/figures_converter/languages/families/cyrillic.rb +2 -0
  111. data/lib/numbers_and_words/strategies/figures_converter/languages/families/helpers.rb +2 -0
  112. data/lib/numbers_and_words/strategies/figures_converter/languages/fr.rb +12 -12
  113. data/lib/numbers_and_words/strategies/figures_converter/languages/hu.rb +2 -2
  114. data/lib/numbers_and_words/strategies/figures_converter/languages/{families/latin.rb → hy.rb} +3 -4
  115. data/lib/numbers_and_words/strategies/figures_converter/languages/it.rb +2 -1
  116. data/lib/numbers_and_words/strategies/figures_converter/languages/ka.rb +13 -15
  117. data/lib/numbers_and_words/strategies/figures_converter/languages/lt.rb +8 -12
  118. data/lib/numbers_and_words/strategies/figures_converter/languages/lv.rb +4 -14
  119. data/lib/numbers_and_words/strategies/figures_converter/languages/nl.rb +3 -5
  120. data/lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb +14 -12
  121. data/lib/numbers_and_words/strategies/figures_converter/languages/pt.rb +3 -3
  122. data/lib/numbers_and_words/strategies/figures_converter/languages/ru.rb +2 -0
  123. data/lib/numbers_and_words/strategies/figures_converter/languages/se.rb +2 -1
  124. data/lib/numbers_and_words/strategies/figures_converter/languages/tr.rb +4 -4
  125. data/lib/numbers_and_words/strategies/figures_converter/languages/ua.rb +2 -0
  126. data/lib/numbers_and_words/strategies/figures_converter/languages/vi.rb +100 -0
  127. data/lib/numbers_and_words/strategies/figures_converter/options.rb +15 -2
  128. data/lib/numbers_and_words/strategies/figures_converter/options/base.rb +5 -0
  129. data/lib/numbers_and_words/strategies/figures_converter/options/base/gender.rb +30 -0
  130. data/lib/numbers_and_words/strategies/figures_converter/options/base/ordinal.rb +28 -0
  131. data/lib/numbers_and_words/strategies/figures_converter/options/base/remove_zero.rb +30 -0
  132. data/lib/numbers_and_words/strategies/figures_converter/options/cs.rb +2 -0
  133. data/lib/numbers_and_words/strategies/figures_converter/options/cs/gender.rb +3 -14
  134. data/lib/numbers_and_words/strategies/figures_converter/options/cs/ordinal.rb +3 -15
  135. data/lib/numbers_and_words/strategies/figures_converter/options/cs/remove_zero.rb +3 -17
  136. data/lib/numbers_and_words/strategies/figures_converter/options/en-GB.rb +2 -0
  137. data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/hundreds_with_union.rb +2 -0
  138. data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/ordinal.rb +2 -0
  139. data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/pronounced.rb +2 -0
  140. data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/remove_hyphen.rb +2 -0
  141. data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/remove_zero.rb +2 -0
  142. data/lib/numbers_and_words/strategies/figures_converter/options/en.rb +2 -0
  143. data/lib/numbers_and_words/strategies/figures_converter/options/en/hundreds_with_union.rb +2 -0
  144. data/lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb +3 -10
  145. data/lib/numbers_and_words/strategies/figures_converter/options/en/pronounced.rb +6 -13
  146. data/lib/numbers_and_words/strategies/figures_converter/options/en/remove_hyphen.rb +2 -0
  147. data/lib/numbers_and_words/strategies/figures_converter/options/en/remove_zero.rb +3 -17
  148. data/lib/numbers_and_words/strategies/figures_converter/options/es.rb +2 -0
  149. data/lib/numbers_and_words/strategies/figures_converter/options/es/apocopated.rb +2 -0
  150. data/lib/numbers_and_words/strategies/figures_converter/options/es/gender.rb +3 -17
  151. data/lib/numbers_and_words/strategies/figures_converter/options/es/remove_zero.rb +3 -17
  152. data/lib/numbers_and_words/strategies/figures_converter/options/hu.rb +2 -0
  153. data/lib/numbers_and_words/strategies/figures_converter/options/hu/ordinal.rb +3 -50
  154. data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR.rb +2 -0
  155. data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR/gender.rb +3 -18
  156. data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR/ordinal.rb +3 -15
  157. data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR/remove_zero.rb +3 -17
  158. data/lib/numbers_and_words/strategies/figures_converter/options/ru.rb +2 -0
  159. data/lib/numbers_and_words/strategies/figures_converter/options/ru/gender.rb +3 -17
  160. data/lib/numbers_and_words/strategies/figures_converter/options/ua.rb +2 -0
  161. data/lib/numbers_and_words/strategies/figures_converter/options/ua/gender.rb +3 -17
  162. data/lib/numbers_and_words/translations.rb +4 -0
  163. data/lib/numbers_and_words/translations/base.rb +3 -1
  164. data/lib/numbers_and_words/translations/cs.rb +6 -31
  165. data/lib/numbers_and_words/translations/de.rb +5 -3
  166. data/lib/numbers_and_words/translations/en-GB.rb +5 -1
  167. data/lib/numbers_and_words/translations/en.rb +2 -0
  168. data/lib/numbers_and_words/translations/es.rb +15 -25
  169. data/lib/numbers_and_words/translations/et.rb +4 -7
  170. data/lib/numbers_and_words/translations/extensions/fraction_significance.rb +6 -4
  171. data/lib/numbers_and_words/translations/families/base.rb +5 -3
  172. data/lib/numbers_and_words/translations/families/cyrillic.rb +6 -8
  173. data/lib/numbers_and_words/translations/families/latin.rb +2 -0
  174. data/lib/numbers_and_words/translations/fr.rb +15 -18
  175. data/lib/numbers_and_words/translations/hu.rb +4 -7
  176. data/lib/numbers_and_words/translations/hy.rb +21 -0
  177. data/lib/numbers_and_words/translations/it.rb +2 -0
  178. data/lib/numbers_and_words/translations/ka.rb +6 -14
  179. data/lib/numbers_and_words/translations/lt.rb +4 -11
  180. data/lib/numbers_and_words/translations/lv.rb +4 -11
  181. data/lib/numbers_and_words/translations/nl.rb +6 -2
  182. data/lib/numbers_and_words/translations/pt-BR.rb +23 -23
  183. data/lib/numbers_and_words/translations/pt.rb +5 -11
  184. data/lib/numbers_and_words/translations/ru.rb +2 -17
  185. data/lib/numbers_and_words/translations/se.rb +2 -0
  186. data/lib/numbers_and_words/translations/tr.rb +2 -4
  187. data/lib/numbers_and_words/translations/ua.rb +2 -13
  188. data/lib/numbers_and_words/translations/vi.rb +24 -0
  189. data/lib/numbers_and_words/version.rb +3 -1
  190. data/lib/numbers_and_words/wrappers.rb +2 -0
  191. data/lib/numbers_and_words/wrappers/float.rb +3 -1
  192. data/lib/numbers_and_words/wrappers/integer.rb +2 -0
  193. metadata +33 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 99432fdd87f3645a56d6ce0aa7167af06e8b429c
4
- data.tar.gz: b909e6a544bb97055e37ad5206ab7cc6c37dcea9
2
+ SHA256:
3
+ metadata.gz: 84a1dae35d34a880f4a6d6509abb36912c5746f43164489a370343e8b06930d3
4
+ data.tar.gz: e6384d6eeb6b96268e0185a84db8707a86b6ca5508aebcbda2157231c710e644
5
5
  SHA512:
6
- metadata.gz: a3c3e5476646cf106cb9f1785afd1eae53719d635ed658d01332d26ec587d5738df28d816708c57b46eb7a875f4292bfaa1c1474ae80584183ede89ca8f41945
7
- data.tar.gz: 9c3ba5f8931deee4e0a1324d438cc7f1d2f74aa3839eec2ee743a34afa28a9fd4d4de3c5590f2726c45c83ff7d81e264f2bbb78c11f2074afdc39c4fb497f004
6
+ metadata.gz: c030f45f26b1d578943e9588ab2917fd8d17f07a6351f44133979f39e8a4f8aac71012ab5411aff89ac11105a86689fc3518622038fadc3866d093762ad4fe4e
7
+ data.tar.gz: c02be4c6e859336bd71df3b23bacfc36fc9738aad8b4f1182b02fc50a1c075c83307e5e8ddc6564de0839e5690f82414ab9e064686f312590c9da98b217cd159
@@ -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
- Convert numbers to words using the I18n library.
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
- Converte números em letras utilizando a biblioteca I18n.
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
- * 1.9.3 <= Ruby (compatible with/совместимость с/compatible avec Ruby 1.9, JRuby and/и/et Rubinius);
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'i18n'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'numbers_and_words/core_ext/integer'
2
4
  require 'numbers_and_words/core_ext/float'
3
5
  require 'numbers_and_words/core_ext/array'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Array
2
4
  def to_words(options = {})
3
5
  map { |element| element.to_words options }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Float
2
4
  def to_words(options = {})
3
5
  NumbersAndWords::Wrappers::Float.new(self).to_words options
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Integer
2
4
  def to_words(options = {})
3
5
  NumbersAndWords::Wrappers::Integer.new(self).to_words options
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'numbers_and_words/helper_classes/figures_array'
2
4
  require 'numbers_and_words/helper_classes/words_array'
@@ -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 > 0
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] && self[1].to_i > 0
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 > 0
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 { |figure| figure != 0 }
82
+ index(&:positive?)
81
83
  end
82
84
 
83
85
  def ordinal_capacity
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'numbers_and_words/helper_classes/array_extensions/helpers'
2
4
 
3
5
  module NumbersAndWords
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'numbers_and_words/helper_classes/array_extensions/helpers'
2
4
 
3
5
  module NumbersAndWords
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'numbers_and_words/i18n/pluralization'
2
4
  require 'numbers_and_words/i18n/initialization'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module NumbersAndWords
2
4
  module I18n
3
5
  module Initialization
@@ -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: [deset, jedenáct, dvanáct, třináct, čtrnáct, patnáct, šestnáct, sedmnáct, osmnáct, devatenáct]
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
- # gem pouziva se deleni po 10^3, http://www.converter.cz/prevody/velka-cisla.htm
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: [desátý, jedenáctý, dvanáctý, třináctý, čtrnáctý, patnáctý, šestnáctý, sedmnáctý, osmnáctý, devatenáctý]
74
- female: [desátá, jedenáctá, dvanáctá, třináctá, čtrnáctá, patnáctá, šestnáctá, sedmnáctá, osmnáctá, devatenáctá]
75
- neuter: [desáté, jedenácté, dvanácté, třinácté, čtrnácté, patnácté, šestnácté, sedmnácté, osmnácté, devatenácté]
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: [zehn, elf, zwölf, dreizehn, vierzehn, fünfzehn, sechzehn, siebzehn, achtzehn, neunzehn]
8
- tens: [null, zehn, zwanzig, dreißig, vierzig, fünfzig, sechzig, siebzig, achtzig, neunzig]
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: [ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen]
5
- tens: [zero, ten, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety]
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: [ones, thousand, million, billion, trillion, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion]
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: [zeroth, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth]
11
+ tens: [_, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth]
12
12
  hundreds: hundredth
13
- mega: [zeroth, thousandth, millionth, billionth, trillionth, quadrillionth, quintillionth, sextillionth, septillionth, octillionth, nonillionth, decillionth]
14
- union_separator: point
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
- union: and
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: [ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen]
5
- tens: [zero, ten, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety]
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: [ones, thousand, million, billion, trillion, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion, undecillion, duodecillion, tredecillion, quattuordecillion]
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: [zeroth, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth]
11
+ tens: [_, tenth, twentieth, thirtieth, fortieth, fiftieth, sixtieth, seventieth, eightieth, ninetieth]
12
12
  hundreds: hundredth
13
- mega: [zeroth, thousandth, millionth, billionth, trillionth, quadrillionth, quintillionth, sextillionth, septillionth, octillionth, nonillionth, decillionth, undecillionth, duodecillionth, tredecillionth, quattuordecillionth]
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
- union_separator: con
99
+ micro_separator: con
100
+ micro_prefix:
101
+ tens: diez
102
+ hundreds: cien
103
+ union: ''
104
+ union: y