numbers_and_words 0.10.5 → 0.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +23 -1
  3. data/lib/numbers_and_words/helper_classes/array_extensions/helpers.rb +13 -0
  4. data/lib/numbers_and_words/i18n/locales/numbers.es.yml +32 -5
  5. data/lib/numbers_and_words/i18n/locales/numbers.pt-BR.yml +92 -0
  6. data/lib/numbers_and_words/i18n/pluralization.rb +1 -0
  7. data/lib/numbers_and_words/i18n/plurals/plurals.rb +1 -1
  8. data/lib/numbers_and_words/i18n/plurals/pt_br.rb +15 -0
  9. data/lib/numbers_and_words/strategies/array_joiner/languages.rb +2 -1
  10. data/lib/numbers_and_words/strategies/array_joiner/languages/pt_br.rb +10 -0
  11. data/lib/numbers_and_words/strategies/figures_converter/decorators.rb +2 -1
  12. data/lib/numbers_and_words/strategies/figures_converter/decorators/pt_br.rb +3 -0
  13. data/lib/numbers_and_words/strategies/figures_converter/decorators/pt_br/base.rb +12 -0
  14. data/lib/numbers_and_words/strategies/figures_converter/decorators/pt_br/fractional.rb +38 -0
  15. data/lib/numbers_and_words/strategies/figures_converter/decorators/pt_br/integral.rb +29 -0
  16. data/lib/numbers_and_words/strategies/figures_converter/languages.rb +1 -0
  17. data/lib/numbers_and_words/strategies/figures_converter/languages/es.rb +28 -19
  18. data/lib/numbers_and_words/strategies/figures_converter/languages/pt_br.rb +118 -0
  19. data/lib/numbers_and_words/strategies/figures_converter/options.rb +2 -1
  20. data/lib/numbers_and_words/strategies/figures_converter/options/en/remove_zero.rb +0 -1
  21. data/lib/numbers_and_words/strategies/figures_converter/options/pt_br.rb +3 -0
  22. data/lib/numbers_and_words/strategies/figures_converter/options/pt_br/gender.rb +29 -0
  23. data/lib/numbers_and_words/strategies/figures_converter/options/pt_br/ordinal.rb +26 -0
  24. data/lib/numbers_and_words/strategies/figures_converter/options/pt_br/remove_zero.rb +28 -0
  25. data/lib/numbers_and_words/translations.rb +1 -0
  26. data/lib/numbers_and_words/translations/es.rb +14 -11
  27. data/lib/numbers_and_words/translations/families/latin.rb +0 -2
  28. data/lib/numbers_and_words/translations/pt_br.rb +77 -0
  29. data/lib/numbers_and_words/version.rb +1 -1
  30. data/lib/numbers_and_words/wrappers/float.rb +14 -2
  31. metadata +16 -5
  32. data/CHANGELOG.md +0 -167
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91ae963e73b41f30a8dd794aba2faa4f1691bbfe
4
- data.tar.gz: e1d052487bff3587903a1e3476ddbdffba5694b3
3
+ metadata.gz: 5caabcd62264f800eee755b1b4d9df3e26985c6e
4
+ data.tar.gz: dc3ed56b19454d61aa519ed095c2445574b2d8cf
5
5
  SHA512:
6
- metadata.gz: eb2244cbb672d3ade661efd805dd92e1d84123e1d160c86ab8a6b4b40260743f06dbc38cc9cd9082679463501209f8328046aad6a31faae7c1e10bd5446a0f01
7
- data.tar.gz: 8c21d510a313020818d60ec531c27a9d5dcdcc1edb39ccf2474cc56b6751377aa9f505db6493460e580395b879b03ba334c139c3b044360123e269ef4fb60bc6
6
+ metadata.gz: 3d764ecdce935eae9b0c7e43a510cb12ca620a25d1e57011aed3e0b1970151f72121785ea3565946cd3bf2896fdc60d376f4fdfb960b0051efd5cbee1edb1d80
7
+ data.tar.gz: 49cfe46d629393bf6737ee713b8ebb632d759bff5954afa6239c5154d5c9419919027a355586a8ab7c71ed13fb1d9477ffaa033fc85272ab7566c457afa25126
data/README.rdoc CHANGED
@@ -16,6 +16,8 @@ Számok betűvel írva az I18n könyvtár segítségével.
16
16
 
17
17
  I18n kütüphanesi ile sayıları yazıya çevirir.
18
18
 
19
+ Converte números em letras utilizando a biblioteca I18n.
20
+
19
21
  == Supported Languages / Языки / Langues Supportées
20
22
 
21
23
  * English [en]
@@ -34,6 +36,8 @@ I18n kütüphanesi ile sayıları yazıya çevirir.
34
36
  * Nederlands** [nl]
35
37
  * Swedish** [se]
36
38
  * English (British)** [en-GB]
39
+ * Português [pt]
40
+ * Português Brasileiro [pt-BR]
37
41
 
38
42
  ** Experimental
39
43
 
@@ -90,12 +94,13 @@ I18n kütüphanesi ile sayıları yazıya çevirir.
90
94
  => "ventiuno"
91
95
  => "éénentwintig"
92
96
  => "tjugo-en"
97
+ => "vinte e um"
93
98
 
94
99
  231.to_words
95
100
  => "two hundred thirty-one"
96
101
  => "doscientos treinta y uno"
97
102
  => "двести тридцать один"
98
- => "deux cent trente-trois"
103
+ => "deux cent trente et un"
99
104
  => "двiстi тридцять один"
100
105
  => "kettőszázharmincegy"
101
106
  => "du šimtai trisdešimt vienas"
@@ -107,6 +112,7 @@ I18n kütüphanesi ile sayıları yazıya çevirir.
107
112
  => "2 cento trentauno"
108
113
  => "tweehonderdéénendertig"
109
114
  => "två hundra trettio-en"
115
+ => "duzentos e trinta e um"
110
116
 
111
117
  4030.to_words
112
118
  => "four thousand thirty"
@@ -241,6 +247,22 @@ I18n kütüphanesi ile sayıları yazıya çevirir.
241
247
  I18n.with_locale(:hu) { 21.to_words ordinal: true }
242
248
  => "huszonegyedik"
243
249
 
250
+ * Brazilian Portuguese
251
+
252
+ Change gender form: (gender: [:female || :male || :neuter])
253
+
254
+ I18n.with_locale(:'pt-BR') { 1000000001.to_words gender: :female }
255
+ => "um bilhão e uma"
256
+
257
+ == Other options / Другие опции
258
+
259
+ * precision
260
+
261
+ You may pass argument :precision that added zeros to the end of float number:
262
+
263
+ I18n.with_locale(:ru) { 0.1.to_words precision: 3 }
264
+ => ноль целых и десять сотых
265
+
244
266
  == Requirements / Требования / Configuration Requise
245
267
 
246
268
  * 1.9.3 <= Ruby (compatible with/совместимость с/compatible avec Ruby 1.9, JRuby and/и/et Rubinius);
@@ -23,6 +23,19 @@ module NumbersAndWords
23
23
  figures_array_in_capacity(capacity).reverse.join.to_i
24
24
  end
25
25
 
26
+ def number_under_capacity capacity
27
+ figures_array_under_capacity(capacity).reverse.join.to_i
28
+ end
29
+
30
+ def is_opaque? capacity
31
+ figures_under = figures_array_under_capacity(capacity)
32
+ figures_under.count(0) == figures_under.length
33
+ end
34
+
35
+ def figures_array_under_capacity capacity
36
+ self[0..(capacity * FIGURES_IN_CAPACITY) - ONES_SHIFT]
37
+ end
38
+
26
39
  def ones
27
40
  self[0].to_i if 0 < self[0].to_i
28
41
  end
@@ -2,14 +2,41 @@ es:
2
2
  numbers:
3
3
  one: un
4
4
  ones: [cero, uno, dos, tres, cuatro, cinco, seis, siete, ocho, nueve]
5
+ one_twenties: ún
5
6
  ones_twenties: [_, uno, dós, trés, cuatro, cinco, séis, siete, ocho, nueve]
6
-
7
7
  teens: [diez, once, doce, trece, catorce, quince, dieciséis, diecisiete, dieciocho, diecinueve]
8
8
  tens: [_, diez, veinti, treinta, cuarenta, cincuenta, sesenta, setenta, ochenta, noventa]
9
9
  twenty: veinte
10
-
11
10
  hundreds: [ciento, doscientos, trescientos, cuatrocientos, quinientos, seiscientos, setecientos, ochocientos, novecientos]
12
11
  one_hundred: cien
13
-
14
- mega: [_, mil, millón, mil millones, billón, mil billones, trillón, mil trillones, cuatrillón, mil cuatrillones, quintillón, mil quintillones]
15
- megas: [_, mil, millones, mil millones, billones, mil billones, trillones, mil trillones, cuatrillones, mil cuatrillones, quintillones, mil quintillones]
12
+ mega: [_, thousand, million, billion, trillion, quadrillion, quintillion, sextillion, septillion, octillion, nonillion, decillion, undecillion, duodecillion, tredecillion, quattuordecillion]
13
+ thousand: mil
14
+ million:
15
+ one: millón
16
+ other: millones
17
+ billion: mil millones
18
+ trillion:
19
+ one: billón
20
+ other: billones
21
+ quadrillion: mil billones
22
+ quintillion:
23
+ one: trillón
24
+ other: trillones
25
+ sextillion: mil trillones
26
+ septillion:
27
+ one: cuatrillón
28
+ other: cuatrillones
29
+ octillion: mil cuatrillones
30
+ nonillion:
31
+ one: quintillón
32
+ other: quintillones
33
+ decillion: mil quintillones
34
+ undecillion:
35
+ one: sextillón
36
+ other: sextillones
37
+ duodecillion: mil sextillones
38
+ tredecillion:
39
+ one: septillón
40
+ other: septillones
41
+ quattuordecillion: mil septillones
42
+ union: y
@@ -0,0 +1,92 @@
1
+ pt-BR:
2
+ numbers:
3
+ union: e
4
+ union_separator: e
5
+ integral:
6
+ one: inteiro
7
+ other: inteiros
8
+ ones:
9
+ male: [zero, um, dois, três, quatro, cinco, seis, sete, oito, nove]
10
+ female: [zero, uma, duas, três, quatro, cinco, seis, sete, oito, nove]
11
+ ones_twenties: [zero, um, dois, três, quatro, cinco, seis, sete, oito, nove]
12
+ one: um
13
+ teens: [dez, onze, doze, treze, quatorze, quinze, dezesseis, dezessete, dezoito, dezenove]
14
+ tens: [zero, dez, vinte, trinta, quarenta, cinquenta, sessenta, setenta, oitenta, noventa]
15
+ hundreds:
16
+ male: [cento, duzentos, trezentos, quatrocentos, quinhentos, seiscentos, setecentos, oitocentos, novecentos]
17
+ female: [cento, duzentas, trezentas, quatrocentas, quinhentas, seiscentas, setecentas, oitocentas, novecentas]
18
+ one_hundred: cem
19
+ mega: [_, mil, milhão, bilhão, trilhão, quadrilhão, quintilhão, sextilhão, septilhão, octilhão, nonilhão, decilhão]
20
+ megas: [_, mil, milhões, bilhões, trilhões, quadrilhões, quintilhões, sextilhões, septilhões, octilhões, nonilhões, decilhões]
21
+ ordinal:
22
+ ones:
23
+ male: [zero, primeiro, segundo, terceiro, quarto, quinto, sexto, sétimo, oitavo, nono]
24
+ female: [zera, primeira, segunda, terceira, quarta, quinta, sexta, sétima, oitava, nona]
25
+ tens:
26
+ male: [_, décimo, vigésimo, trigésimo, quadragésimo, quinquagésimo, sexagésimo, septuagésimo, octogésimo, nonagésimo]
27
+ female: [_, décima, vigésima, trigésima, quadragésima, quinquagésima, sexagésima, septuagésima, octogésima, nonagésima]
28
+ hundreds:
29
+ male: [centésimo, ducentésimo, trecentésimo, quadringentésimo, quingentésimo, sexcentésimo, septingentésimo, octingentésimo, noningentésimo]
30
+ female: [centésima, ducentésima, trecentésima, quadringentésima, quingentésima, sexcentésima, septingentésima, octingentésima, noningentésima]
31
+ mega:
32
+ male: [_, milésimo, milionésimo, bilionésimo, trilionésimo, quadrilionésimo, sextilionésimo, septilionésimo, octilionésimo, nonilionésimo]
33
+ female: [_, milésima, milionésima, bilionésima, trilionésima, quadrilionésima, sextilionésima, septilionésima, octilionésima, nonilionésima]
34
+ micro: [_, tenths, hundredths, thousandths, millionths, billionths, trillionths, quadrillionths, quintillionths, sextillionths, septillionths, octillionths, nonillionths, decillionths, undecillionths, duodecillionths, tredecillionths, quattuordecillionths]
35
+ micro_prefix:
36
+ tens:
37
+ one: décimo
38
+ other: décimos
39
+ hundreds:
40
+ one: centésimo
41
+ other: centésimos
42
+ tenths:
43
+ one: décimo
44
+ other: décimos
45
+ hundredths:
46
+ one: centésimo
47
+ other: centésimos
48
+ thousandths:
49
+ one: milésimo
50
+ other: milésimos
51
+ millionths:
52
+ one: milionésimo
53
+ other: milionésimos
54
+ billionths:
55
+ one: bilionésimo
56
+ other: bilionésimos
57
+ trillionths:
58
+ one: trilionésimo
59
+ other: trilionésimo
60
+ quadrillionths:
61
+ one: quadrilionésimo
62
+ other: quadrilionésimos
63
+ quintillionths:
64
+ one: quintilionésimo
65
+ other: quintilionésimos
66
+ sextillionths:
67
+ one: sextilionésimo
68
+ other: sextilionésimos
69
+ septillionths:
70
+ one: septilionésimo
71
+ other: septilionésimos
72
+ octillionths:
73
+ one: octilionésimo
74
+ other: octilionésimos
75
+ nonillionths:
76
+ one: nonilionésimo
77
+ other: nonilionésimos
78
+ decillionths:
79
+ one: decilionésimo
80
+ other: decilionésimos
81
+ undecillionths:
82
+ one: undecilionésimo
83
+ other: undecilionésimos
84
+ duodecillion:
85
+ one: duodecilionésimo
86
+ other: duodecilionésimos
87
+ tredecillion:
88
+ one: trecentilionésimo
89
+ other: trecentilionésimos
90
+ quattuordecillion:
91
+ one: quadringentilionésimo
92
+ other: quadringentilionésimos
@@ -3,6 +3,7 @@ require 'numbers_and_words/i18n/plurals/ua'
3
3
  require 'numbers_and_words/i18n/plurals/fr'
4
4
  require 'numbers_and_words/i18n/plurals/lv'
5
5
  require 'numbers_and_words/i18n/plurals/lt'
6
+ require 'numbers_and_words/i18n/plurals/pt_br'
6
7
 
7
8
  module NumbersAndWords
8
9
  module I18n
@@ -1,7 +1,7 @@
1
1
  Hash[
2
2
  NumbersAndWords::I18n::Pluralization.languages.map { |language|
3
3
  [language.to_sym, {:i18n => {:plural => {
4
- :rule => "NumbersAndWords::I18n::Plurals::#{language.titleize}::RULE".constantize
4
+ :rule => "NumbersAndWords::I18n::Plurals::#{language.titleize.gsub(/ /, '')}::RULE".constantize
5
5
  }}}]
6
6
  }
7
7
  ]
@@ -0,0 +1,15 @@
1
+ module NumbersAndWords
2
+ module I18n
3
+ module Plurals
4
+ module PtBr
5
+ RULE = lambda { |n| one_conditions(n) ? :one : :other }
6
+
7
+ extend self
8
+
9
+ def one_conditions n
10
+ n == 1
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -7,6 +7,7 @@ require 'numbers_and_words/strategies/array_joiner/languages/en_gb'
7
7
  require 'numbers_and_words/strategies/array_joiner/languages/hu'
8
8
  require 'numbers_and_words/strategies/array_joiner/languages/ru'
9
9
  require 'numbers_and_words/strategies/array_joiner/languages/ua'
10
+ require 'numbers_and_words/strategies/array_joiner/languages/pt_br'
10
11
 
11
12
  module NumbersAndWords
12
13
  module Strategies
@@ -20,4 +21,4 @@ module NumbersAndWords
20
21
  end
21
22
  end
22
23
  end
23
- end
24
+ end
@@ -0,0 +1,10 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module ArrayJoiner
4
+ module Languages
5
+ class PtBr < Base
6
+ end
7
+ end
8
+ end
9
+ end
10
+ end
@@ -2,6 +2,7 @@ require 'numbers_and_words/strategies/figures_converter/decorators/base'
2
2
  require 'numbers_and_words/strategies/figures_converter/decorators/en'
3
3
  require 'numbers_and_words/strategies/figures_converter/decorators/en_gb'
4
4
  require 'numbers_and_words/strategies/figures_converter/decorators/ru'
5
+ require 'numbers_and_words/strategies/figures_converter/decorators/pt_br'
5
6
  require 'numbers_and_words/strategies/figures_converter/decorators/hu'
6
7
  require 'numbers_and_words/strategies/figures_converter/decorators/ua'
7
8
 
@@ -33,4 +34,4 @@ module NumbersAndWords
33
34
  end
34
35
  end
35
36
  end
36
- end
37
+ end
@@ -0,0 +1,3 @@
1
+ require 'numbers_and_words/strategies/figures_converter/decorators/pt_br/base'
2
+ require 'numbers_and_words/strategies/figures_converter/decorators/pt_br/integral'
3
+ require 'numbers_and_words/strategies/figures_converter/decorators/pt_br/fractional'
@@ -0,0 +1,12 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Decorators
5
+ module PtBr
6
+ class Base < Decorators::Base
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,38 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Decorators
5
+ module PtBr
6
+ class Fractional < Base
7
+
8
+ def run
9
+ "#{super} #{fraction_significance}"
10
+ end
11
+
12
+ private
13
+
14
+ def fraction_significance
15
+ @strategy.translations.micros full_fraction.fraction_capacity, figures.join.to_i
16
+ end
17
+
18
+ def full_fraction
19
+ (0..zero_length).inject(figures.clone) { |result, el| result.unshift 0 }.to_figures
20
+ end
21
+
22
+ def figures
23
+ @strategy.figures.reverse
24
+ end
25
+
26
+ def zero_length
27
+ fraction_length - figures.length
28
+ end
29
+
30
+ def fraction_length
31
+ @options[:fractional][:length].to_i
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,29 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Decorators
5
+ module PtBr
6
+ class Integral < Base
7
+ def run
8
+ "#{super}#{integral_significance}"
9
+ end
10
+
11
+ private
12
+
13
+ def integral_significance
14
+ " #{@strategy.translations.integral quantity}" if @options[:remove_zero].nil?
15
+ end
16
+
17
+ def quantity
18
+ figures.reverse.join.to_i
19
+ end
20
+
21
+ def figures
22
+ @strategy.language.figures
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -24,6 +24,7 @@ require 'numbers_and_words/strategies/figures_converter/languages/families/cyril
24
24
  require 'numbers_and_words/strategies/figures_converter/languages/ru'
25
25
  require 'numbers_and_words/strategies/figures_converter/languages/ua'
26
26
  require 'numbers_and_words/strategies/figures_converter/languages/pt'
27
+ require 'numbers_and_words/strategies/figures_converter/languages/pt_br'
27
28
 
28
29
  require 'numbers_and_words/strategies/figures_converter/languages/ka'
29
30
 
@@ -8,36 +8,45 @@ module NumbersAndWords
8
8
  def capacity_iteration
9
9
  words = []
10
10
  capacity_words = words_in_capacity(@current_capacity)
11
- words.push megs(capacity_words) unless capacity_words.empty?
11
+ words.push megs unless capacity_words.empty?
12
12
 
13
- if 0 < @current_capacity
14
- # eg 1000000 should be "un millón" not "uno millón"
15
- # 501000 should be "quinientos un mil" not "quinientos uno mil"
16
- # 1000 should be "mil" not "uno mil"
17
- # so we replace "uno" with "un" throughout or delete it if that is the case
18
-
19
- capacity_words = capacity_words.map { |word|
20
- word.gsub(@translations.ones(1), @translations.one) unless is_a_thousand? and is_a_one?
21
- }.compact
22
- end
13
+ capacity_words = capacity_words.map do |word|
14
+ if twenty_one?
15
+ word.gsub(@translations.ones(1), @translations.one_twenties)
16
+ elsif !thousand? || !one?
17
+ word.gsub(@translations.ones(1), @translations.one)
18
+ end
19
+ end.compact
23
20
 
24
21
  words + capacity_words
25
22
  end
26
23
 
27
- def is_a_one?
28
- [translations.ones(1)] == words_in_capacity(@current_capacity)
24
+ def hundreds
25
+ super({ is_hundred: (figures[1, 2] == [0, 1] &&
26
+ simple_number_to_words.empty?) })
29
27
  end
30
28
 
31
- def is_a_thousand?
32
- @current_capacity.odd?
29
+ def megs
30
+ if thousand? &&
31
+ @figures.number_in_capacity(@current_capacity - 1) != 0
32
+ @translations.thousand
33
+ else
34
+ super({ number: @figures.number_in_capacity(@current_capacity) })
35
+ end
33
36
  end
34
37
 
35
- def hundreds
36
- super({:is_hundred => (figures[1,2] == [0,1] && simple_number_to_words.empty?)})
38
+ private
39
+
40
+ def one?
41
+ [@translations.ones(1)] == words_in_capacity(@current_capacity)
42
+ end
43
+
44
+ def thousand?
45
+ @current_capacity.odd?
37
46
  end
38
47
 
39
- def megs capacity_words
40
- super({:is_one => capacity_words == [@translations.ones(1)]})
48
+ def twenty_one?
49
+ figures.reverse[0..1] == [2, 1]
41
50
  end
42
51
  end
43
52
  end
@@ -0,0 +1,118 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Languages
5
+ class PtBr < Base
6
+ include Families::Latin
7
+
8
+ [:teens, :tens, :tens_with_ones].each do |method_name|
9
+ define_method(method_name) {
10
+ super(internal_options)
11
+ }
12
+ end
13
+
14
+ def zero
15
+ super unless maybe_remove_zero
16
+ end
17
+
18
+ def words
19
+ super.strip
20
+ end
21
+
22
+ def complex_number_to_words
23
+ super.reject { |x| x.nil? }
24
+ end
25
+
26
+ def capacity_iteration
27
+ words = []
28
+ capacity_words = words_in_capacity(current_capacity)
29
+ words.push(megs) unless capacity_words.empty? || (capacity_words.empty? && figures[0] == 1)
30
+ words + capacity_words
31
+ end
32
+
33
+ def ones
34
+ super internal_options.merge({:is_one_thousand => is_one_thousand?})
35
+ end
36
+
37
+ def hundreds
38
+ super(internal_options.merge({:is_hundred => is_hundred?, :is_one_hundred => is_one_hundred?, :gender => gender}))
39
+ end
40
+
41
+ def megs
42
+ super(internal_options.merge({
43
+ :is_one => words_in_capacity(current_capacity) == [translations.ones(1, internal_options)],
44
+ :is_opaque => is_opaque?,
45
+ :is_without_connector => is_without_connector?,
46
+ :is_with_comma => is_with_comma?
47
+ }))
48
+ end
49
+
50
+ private
51
+
52
+ def internal_options
53
+ {:gender => gender, :prefix => maybe_ordinal}
54
+ end
55
+
56
+ def maybe_ordinal
57
+ @options.ordinal.result
58
+ end
59
+
60
+ def gender
61
+ return (options.gender.result || :male) if maybe_ordinal
62
+
63
+ @current_capacity ||= 0
64
+ if @current_capacity > 0 && figures[0] == 1
65
+ :male
66
+ else
67
+ options.gender.result
68
+ end
69
+ end
70
+
71
+ def is_hundred?
72
+ figures[0] == 0 && figures[1] == 0 && simple_number_to_words.empty?
73
+ end
74
+
75
+ def is_one_hundred?
76
+ is_hundred? && figures[2] == 1
77
+ end
78
+
79
+ def is_opaque?
80
+ figures.is_opaque? current_capacity
81
+ end
82
+
83
+ def is_one_thousand?
84
+ @current_capacity == 1 && figures[0] == 1 && figures.hundreds.nil? && figures.tens.nil?
85
+ end
86
+
87
+ def is_without_connector?
88
+ return false if is_with_comma?
89
+ # without connector when there is hundreds and tens_with_ones
90
+ return true if figures.hundreds and figures.tens_with_ones
91
+ # without connector when there is hundreds and tens
92
+ return true if figures.hundreds and figures.tens
93
+ # without connector when there is hundreds and ones
94
+ return true if figures.hundreds and figures.ones
95
+ false
96
+ end
97
+
98
+ def is_with_comma?
99
+ return false unless @current_capacity > 1
100
+ # if any lower capacity is single word, in portuguese only tens are single words
101
+ number_under_capacity = figures.number_under_capacity(@current_capacity)
102
+ return false if number_under_capacity < 20
103
+
104
+ figures_under_capacity = figures.figures_array_under_capacity(@current_capacity)
105
+ return false if figures_under_capacity.count(0) == (figures_under_capacity.size - 1)
106
+
107
+ # else use comma
108
+ true
109
+ end
110
+
111
+ def maybe_remove_zero
112
+ @options.remove_zero.result
113
+ end
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
@@ -1,6 +1,7 @@
1
1
  require 'numbers_and_words/strategies/figures_converter/options/en'
2
2
  require 'numbers_and_words/strategies/figures_converter/options/en_gb'
3
3
  require 'numbers_and_words/strategies/figures_converter/options/ru'
4
+ require 'numbers_and_words/strategies/figures_converter/options/pt_br'
4
5
  require 'numbers_and_words/strategies/figures_converter/options/ua'
5
6
  require 'numbers_and_words/strategies/figures_converter/options/hu'
6
7
 
@@ -35,4 +36,4 @@ module NumbersAndWords
35
36
  end
36
37
  end
37
38
  end
38
- end
39
+ end
@@ -11,7 +11,6 @@ module NumbersAndWords
11
11
  @options = proxy.options
12
12
  end
13
13
 
14
-
15
14
  def result
16
15
  active?
17
16
  end
@@ -0,0 +1,3 @@
1
+ require 'numbers_and_words/strategies/figures_converter/options/pt_br/gender'
2
+ require 'numbers_and_words/strategies/figures_converter/options/pt_br/ordinal'
3
+ require 'numbers_and_words/strategies/figures_converter/options/pt_br/remove_zero'
@@ -0,0 +1,29 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Options
5
+ module PtBr
6
+ class Gender
7
+ attr_accessor :strategy, :options
8
+
9
+ def initialize proxy, *args, &block
10
+ @strategy = proxy.strategy
11
+ @options = proxy.options
12
+ end
13
+
14
+ def result
15
+ gender = active? ? @options[:gender].to_sym : :male
16
+ [:male, :female].include?(gender) ? gender : :male
17
+ end
18
+
19
+ private
20
+
21
+ def active?
22
+ @options[:gender]
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,26 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Options
5
+ module PtBr
6
+ class Ordinal
7
+ def initialize proxy, *args, &block
8
+ @strategy = proxy.strategy
9
+ @options = proxy.options
10
+ end
11
+
12
+ def result
13
+ return :ordinal if active?
14
+ end
15
+
16
+ private
17
+
18
+ def active?
19
+ @options[:ordinal]
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,28 @@
1
+ module NumbersAndWords
2
+ module Strategies
3
+ module FiguresConverter
4
+ module Options
5
+ module PtBr
6
+ class RemoveZero
7
+ attr_accessor :strategy, :options
8
+
9
+ def initialize proxy, *args, &block
10
+ @strategy = proxy.strategy
11
+ @options = proxy.options
12
+ end
13
+
14
+ def result
15
+ active?
16
+ end
17
+
18
+ private
19
+
20
+ def active?
21
+ @options[:remove_zero]
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -19,6 +19,7 @@ require 'numbers_and_words/translations/lv'
19
19
  require 'numbers_and_words/translations/lt'
20
20
  require 'numbers_and_words/translations/de'
21
21
  require 'numbers_and_words/translations/pt'
22
+ require 'numbers_and_words/translations/pt_br'
22
23
  require 'numbers_and_words/translations/ka'
23
24
 
24
25
  module NumbersAndWords
@@ -5,37 +5,40 @@ module NumbersAndWords
5
5
 
6
6
  TENS_CASE = 2
7
7
 
8
- def one options = {}
8
+ def one
9
9
  t(:one)
10
10
  end
11
11
 
12
- def ones number, options = {}
12
+ def ones(number, _options = {})
13
13
  t(:ones)[number]
14
14
  end
15
15
 
16
- def ones_twenties number, options = {}
16
+ def one_twenties
17
+ t(:one_twenties)
18
+ end
19
+
20
+ def ones_twenties(number)
17
21
  t(:ones_twenties)[number]
18
22
  end
19
23
 
20
- def tens numbers, options = {}
24
+ def tens(numbers, options = {})
21
25
  options[:alone] = true if options[:alone].nil?
22
26
  (numbers == TENS_CASE && options[:alone]) ? t(:twenty) : super(numbers)
23
27
  end
24
28
 
25
- def tens_with_ones numbers, options = {}
26
- inter = numbers[1] == TENS_CASE ? "" : " y "
29
+ def tens_with_ones(numbers, _options = {})
30
+ union = numbers[1] == TENS_CASE ? '' : " #{t(:union)} "
27
31
  ones_number = numbers[1] == TENS_CASE ? ones_twenties(numbers[0]) : ones(numbers[0])
28
- [tens(numbers[1], :alone => false), ones_number].join inter
32
+ [tens(numbers[1], alone: false), union, ones_number].join
29
33
  end
30
34
 
31
- def hundreds number, options = {}
35
+ def hundreds(number, options = {})
32
36
  options[:is_hundred] = false if options[:is_hundred].nil?
33
37
  options[:is_hundred] ? t(:one_hundred) : t(:hundreds)[number - 1]
34
38
  end
35
39
 
36
- def megs capacity, options = {}
37
- options[:is_one] = false if options[:is_one].nil?
38
- options[:is_one] ? t(:mega)[capacity] : t(:megas)[capacity]
40
+ def thousand
41
+ t(:thousand)
39
42
  end
40
43
  end
41
44
  end
@@ -4,8 +4,6 @@ module NumbersAndWords
4
4
  module Latin
5
5
  include NumbersAndWords::Translations::Families::Base
6
6
 
7
- #private
8
-
9
7
  def ones number, options = {}
10
8
  t([options[:prefix], :ones].join('.'))[number]
11
9
  end
@@ -0,0 +1,77 @@
1
+ module NumbersAndWords
2
+ module Translations
3
+ class PtBr < Base
4
+ include NumbersAndWords::Translations::Families::Latin
5
+ include NumbersAndWords::Translations::Extensions::FractionSignificance
6
+
7
+ def integral number, options = {}
8
+ t(:integral, :count => number)
9
+ end
10
+
11
+ def zero options = {}
12
+ t([options[:prefix], :ones, :male].join('.'))[0]
13
+ end
14
+
15
+ def ones number, options = {}
16
+ return if options[:is_one_thousand]
17
+ t([options[:prefix], :ones, options[:gender]].join('.'))[number]
18
+ end
19
+
20
+ def tens number, options = {}
21
+ options[:alone] = true if options[:alone].nil?
22
+ path = [options[:prefix], :tens]
23
+ path.push(options[:gender]) if ordinal? options
24
+ translated = t(path.join('.'))[number]
25
+ options[:alone] ? translated : "#{union} " + translated
26
+ end
27
+
28
+ def teens number, options = {}
29
+ return [tens(1, options), ' ', ones(number[0], options)].join if ordinal? options
30
+ super(number, options)
31
+ end
32
+
33
+ def tens_with_ones numbers, options = {}
34
+ connector = ' '
35
+ connector = " #{union} " unless ordinal? options
36
+ [tens(numbers[1], options), connector, ones(numbers[0], options)].join
37
+ end
38
+
39
+ def hundreds number, options = {}
40
+ return t(:one_hundred) if options[:is_one_hundred] and !(ordinal? options)
41
+ translated = t([options[:prefix], :hundreds, options[:gender]].join('.'))[number - 1]
42
+ return translated if ordinal? options
43
+ options[:is_hundred] ? translated : translated + " #{union}"
44
+ end
45
+
46
+ def megs capacity, options = {}
47
+ return t([options[:prefix], :mega, options[:gender]].join('.'))[capacity] if ordinal? options
48
+
49
+ options[:is_one] = false if options[:is_one].nil?
50
+ connector = " #{union}"
51
+ connector = ',' if options[:is_with_comma]
52
+ suffix = options[:is_opaque] ? '' : connector
53
+ suffix = options[:is_without_connector] ? '' : suffix
54
+ (options[:is_one] ? t(:mega)[capacity] : t(:megas)[capacity]) + suffix
55
+ end
56
+
57
+ def micros capacity, number, separator = ' de '
58
+ micro, prefix = capacity
59
+ micros = number ? t(micro(micro), :count => number) : micro(micro)
60
+ [micro_prefix(prefix, number), micros].compact.join separator
61
+ end
62
+
63
+ def micro_prefix capacity, number
64
+ case capacity
65
+ when 2 then t('micro_prefix.hundreds', :count => number)
66
+ when 1 then t('micro_prefix.tens', :count => number)
67
+ end
68
+ end
69
+
70
+ private
71
+
72
+ def ordinal? options
73
+ options[:prefix] == :ordinal
74
+ end
75
+ end
76
+ end
77
+ end
@@ -1,3 +1,3 @@
1
1
  module NumbersAndWords
2
- VERSION = '0.10.5'
2
+ VERSION = '0.10.6'
3
3
  end
@@ -1,6 +1,8 @@
1
1
  module NumbersAndWords
2
2
  module Wrappers
3
3
  class Float
4
+ ZERO_SYMBOL = '0'
5
+
4
6
  attr_accessor :number
5
7
 
6
8
  def initialize number
@@ -8,6 +10,7 @@ module NumbersAndWords
8
10
  end
9
11
 
10
12
  def to_words options = {}
13
+ @options = options
11
14
  words = []
12
15
  words << integral_part_with(options)
13
16
  words << fractional_part_with(options) unless fractional_part_is_nil?
@@ -16,6 +19,8 @@ module NumbersAndWords
16
19
 
17
20
  private
18
21
 
22
+ attr_accessor :options
23
+
19
24
  def parts
20
25
  number.to_s.split '.'
21
26
  end
@@ -25,7 +30,9 @@ module NumbersAndWords
25
30
  end
26
31
 
27
32
  def fractional_part
28
- parts.last
33
+ part = parts.last
34
+ part += ZERO_SYMBOL*(precision - part.length) if precision
35
+ part
29
36
  end
30
37
 
31
38
  def integral_part_with options
@@ -41,12 +48,17 @@ module NumbersAndWords
41
48
  end
42
49
 
43
50
  def fractional_options
44
- {:fractional => {:length => fractional_part.length}}
51
+ length = precision || fractional_part.length
52
+ {:fractional => {:length => length}}
45
53
  end
46
54
 
47
55
  def fractional_part_is_nil?
48
56
  0 == fractional_part.to_i
49
57
  end
58
+
59
+ def precision
60
+ options.fetch(:precision, nil)
61
+ end
50
62
  end
51
63
  end
52
64
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numbers_and_words
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.5
4
+ version: 0.10.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Lazarev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-09 00:00:00.000000000 Z
11
+ date: 2017-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -71,11 +71,9 @@ email: k.s.lazarev@gmail.com
71
71
  executables: []
72
72
  extensions: []
73
73
  extra_rdoc_files:
74
- - CHANGELOG.md
75
74
  - LICENSE.txt
76
75
  - README.rdoc
77
76
  files:
78
- - CHANGELOG.md
79
77
  - LICENSE.txt
80
78
  - README.rdoc
81
79
  - lib/numbers_and_words.rb
@@ -102,6 +100,7 @@ files:
102
100
  - lib/numbers_and_words/i18n/locales/numbers.lt.yml
103
101
  - lib/numbers_and_words/i18n/locales/numbers.lv.yml
104
102
  - lib/numbers_and_words/i18n/locales/numbers.nl.yml
103
+ - lib/numbers_and_words/i18n/locales/numbers.pt-BR.yml
105
104
  - lib/numbers_and_words/i18n/locales/numbers.pt.yml
106
105
  - lib/numbers_and_words/i18n/locales/numbers.ru.yml
107
106
  - lib/numbers_and_words/i18n/locales/numbers.se.yml
@@ -112,6 +111,7 @@ files:
112
111
  - lib/numbers_and_words/i18n/plurals/lt.rb
113
112
  - lib/numbers_and_words/i18n/plurals/lv.rb
114
113
  - lib/numbers_and_words/i18n/plurals/plurals.rb
114
+ - lib/numbers_and_words/i18n/plurals/pt_br.rb
115
115
  - lib/numbers_and_words/i18n/plurals/ru.rb
116
116
  - lib/numbers_and_words/i18n/plurals/ua.rb
117
117
  - lib/numbers_and_words/strategies.rb
@@ -122,6 +122,7 @@ files:
122
122
  - lib/numbers_and_words/strategies/array_joiner/languages/en_gb.rb
123
123
  - lib/numbers_and_words/strategies/array_joiner/languages/families/base.rb
124
124
  - lib/numbers_and_words/strategies/array_joiner/languages/hu.rb
125
+ - lib/numbers_and_words/strategies/array_joiner/languages/pt_br.rb
125
126
  - lib/numbers_and_words/strategies/array_joiner/languages/ru.rb
126
127
  - lib/numbers_and_words/strategies/array_joiner/languages/ua.rb
127
128
  - lib/numbers_and_words/strategies/figures_converter.rb
@@ -139,6 +140,10 @@ files:
139
140
  - lib/numbers_and_words/strategies/figures_converter/decorators/hu/base.rb
140
141
  - lib/numbers_and_words/strategies/figures_converter/decorators/hu/fractional.rb
141
142
  - lib/numbers_and_words/strategies/figures_converter/decorators/hu/integral.rb
143
+ - lib/numbers_and_words/strategies/figures_converter/decorators/pt_br.rb
144
+ - lib/numbers_and_words/strategies/figures_converter/decorators/pt_br/base.rb
145
+ - lib/numbers_and_words/strategies/figures_converter/decorators/pt_br/fractional.rb
146
+ - lib/numbers_and_words/strategies/figures_converter/decorators/pt_br/integral.rb
142
147
  - lib/numbers_and_words/strategies/figures_converter/decorators/ru.rb
143
148
  - lib/numbers_and_words/strategies/figures_converter/decorators/ru/base.rb
144
149
  - lib/numbers_and_words/strategies/figures_converter/decorators/ru/fractional.rb
@@ -166,6 +171,7 @@ files:
166
171
  - lib/numbers_and_words/strategies/figures_converter/languages/lv.rb
167
172
  - lib/numbers_and_words/strategies/figures_converter/languages/nl.rb
168
173
  - lib/numbers_and_words/strategies/figures_converter/languages/pt.rb
174
+ - lib/numbers_and_words/strategies/figures_converter/languages/pt_br.rb
169
175
  - lib/numbers_and_words/strategies/figures_converter/languages/ru.rb
170
176
  - lib/numbers_and_words/strategies/figures_converter/languages/se.rb
171
177
  - lib/numbers_and_words/strategies/figures_converter/languages/tr.rb
@@ -185,6 +191,10 @@ files:
185
191
  - lib/numbers_and_words/strategies/figures_converter/options/en_gb/remove_zero.rb
186
192
  - lib/numbers_and_words/strategies/figures_converter/options/hu.rb
187
193
  - lib/numbers_and_words/strategies/figures_converter/options/hu/ordinal.rb
194
+ - lib/numbers_and_words/strategies/figures_converter/options/pt_br.rb
195
+ - lib/numbers_and_words/strategies/figures_converter/options/pt_br/gender.rb
196
+ - lib/numbers_and_words/strategies/figures_converter/options/pt_br/ordinal.rb
197
+ - lib/numbers_and_words/strategies/figures_converter/options/pt_br/remove_zero.rb
188
198
  - lib/numbers_and_words/strategies/figures_converter/options/ru.rb
189
199
  - lib/numbers_and_words/strategies/figures_converter/options/ru/gender.rb
190
200
  - lib/numbers_and_words/strategies/figures_converter/options/ua.rb
@@ -208,6 +218,7 @@ files:
208
218
  - lib/numbers_and_words/translations/lv.rb
209
219
  - lib/numbers_and_words/translations/nl.rb
210
220
  - lib/numbers_and_words/translations/pt.rb
221
+ - lib/numbers_and_words/translations/pt_br.rb
211
222
  - lib/numbers_and_words/translations/ru.rb
212
223
  - lib/numbers_and_words/translations/se.rb
213
224
  - lib/numbers_and_words/translations/tr.rb
@@ -236,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
247
  version: '0'
237
248
  requirements: []
238
249
  rubyforge_project:
239
- rubygems_version: 2.4.8
250
+ rubygems_version: 2.6.12
240
251
  signing_key:
241
252
  specification_version: 4
242
253
  summary: Convert numbers to words using I18N.
data/CHANGELOG.md DELETED
@@ -1,167 +0,0 @@
1
- ## 0.10.5 (March 9, 2016)
2
-
3
- ### Bugs
4
- * Fix pluralization rules for Spanish. \[[#122](https://github.com/kslazarev/numbers_and_words/pull/122)\] \([@jlduran](https://github.com/jlduran)\)
5
- * Fix long scale names in Spanish. \[[#112](https://github.com/kslazarev/numbers_and_words/pull/112)\] \([@jlduran](https://github.com/jlduran)\)
6
- * Fix Turkish hundred and thousand numbers. \[[#113](https://github.com/kslazarev/numbers_and_words/pull/113)\] \([@cbilgili](https://github.com/cbilgili)\)
7
- * Fix one/other convention in Spanish and French. \[[#116](https://github.com/kslazarev/numbers_and_words/pull/116)\] \([@joseramonc](https://github.com/joseramonc)\)
8
- * Fix hundreds in Lithuanian. \[[#117](https://github.com/kslazarev/numbers_and_words/pull/117)\] \([@osegrums](https://github.com/osegrums)\)
9
-
10
- ## 0.10.4 (March 02, 2015)
11
-
12
- ### Bugs
13
- * Fix Lithuanian `other` spelling errors. \[[#109](https://github.com/kslazarev/numbers_and_words/pull/109)\] \([@ViliusLuneckas](https://github.com/ViliusLuneckas)\) \(assignee: [@miks](https://github.com/miks)\)
14
-
15
- ## 0.10.3 (May 8, 2014)
16
-
17
- ### Features
18
- * Add Georgian language. \[[#100](https://github.com/kslazarev/numbers_and_words/pull/100)\] \([@miks](https://github.com/miks)\) \(assignee: [@miks](https://github.com/miks)\)
19
-
20
- ### Bugs
21
- * Simplify estonian tens with ones method. \[[#101](https://github.com/kslazarev/numbers_and_words/pull/101)\] \([@miks](https://github.com/miks)\) \(assignee: [@miks](https://github.com/miks)\)
22
-
23
- ## 0.10.2 (December 18, 2013)
24
-
25
- ### Bugs
26
- * Fix latvian one thousand case. \[[#88](https://github.com/kslazarev/numbers_and_words/pull/88)\] \([@miks](https://github.com/miks)\) \(assignee: [@miks](https://github.com/miks)\)
27
-
28
- ### Supports
29
- * Reach 100% coverage. \[[#89](https://github.com/kslazarev/numbers_and_words/pull/89)\] \([@miks](https://github.com/miks)\) \(assignee: [@miks](https://github.com/miks)\)
30
-
31
- ## 0.10.1 (October 22, 2013)
32
-
33
- ### Bugs
34
- * Minor orthographic typo in Spanish language. \[[#85](https://github.com/kslazarev/numbers_and_words/pull/85)\] \([@jlduran](https://github.com/jlduran)\) \(assignee: [@jlduran](https://github.com/jlduran)\)
35
-
36
- ## 0.10.0 (September 03, 2013)
37
-
38
- ### Features
39
- * Add Estonian language. \[[#82](https://github.com/kslazarev/numbers_and_words/pull/82)\] \([@miks](https://github.com/miks)\) \(assignee: [@miks](https://github.com/miks)\)
40
- * Add Lithuanian language. \[[#77](https://github.com/kslazarev/numbers_and_words/pull/77)\] \([@miks](https://github.com/miks)\) \(assignee: [@miks](https://github.com/miks)\)
41
-
42
- ### Bugs
43
- * Fix latvian one hundread cases. \[[#81](https://github.com/kslazarev/numbers_and_words/pull/81)\] \([@miks](https://github.com/miks)\) \(assignee: [@miks](https://github.com/miks)\)
44
-
45
- ### Supports
46
- * Added @miks contacts to contributors list in README. \[[#79](https://github.com/kslazarev/numbers_and_words/issues/79)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@miks](https://github.com/miks)\)
47
-
48
- ## 0.9.0 (May 19, 2013)
49
-
50
- ### Features
51
- * Add Latvian language. \[[#70](https://github.com/kslazarev/numbers_and_words/pull/70)\] \([@martinsspringis](https://github.com/martinsspringis)\) \(assignee: [@martinsspringis](https://github.com/martinsspringis)\)
52
- * Add German language. \[[#52](https://github.com/kslazarev/numbers_and_words/pull/52)\] \([@GSI](https://github.com/GSI)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
53
-
54
- ### Supports
55
- * Add @martinsspringis contacts and some examples on Latvian language to README. \[[#71](https://github.com/kslazarev/numbers_and_words/issues/71)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@martinsspringis](https://github.com/martinsspringis)\)
56
-
57
- ## 0.8.0 (April 29, 2013)
58
-
59
- ### Features
60
- * Try to use global language by default, if regional language is missing (EnUs is missing). \[[#65](https://github.com/kslazarev/numbers_and_words/issues/65)\] \([@hubrix](https://github.com/hubrix)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
61
-
62
- ### Supports
63
- * Add regional languages aliases to README. \[[#67](https://github.com/kslazarev/numbers_and_words/issues/67)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
64
- * Remove all warnings in gem. (ruby -w). \[[#66](https://github.com/kslazarev/numbers_and_words/pull/66)\] \([@nikhaldi](https://github.com/nikhaldi)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
65
-
66
- ## 0.7.1 (April 22, 2013)
67
-
68
- ### Bugs
69
- * Wrong hundreds separator with British. \[[#62](https://github.com/kslazarev/numbers_and_words/issues/62)\] \([@eLod](https://github.com/eLod)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
70
-
71
- ## 0.7.0 (April 14, 2013)
72
-
73
- ### Features
74
- * Send number's options through array. \[[#60](https://github.com/kslazarev/numbers_and_words/issues/60)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
75
- * Add British English. \[[#57](https://github.com/kslazarev/numbers_and_words/issues/57)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@eLod](https://github.com/eLod)\)
76
-
77
- ## 0.6.1 (April 11, 2013)
78
-
79
- ### Bugs
80
- * Extra 'and' added after round hundreds (using hundreds_with_union: true) in English. \[[#58](https://github.com/kslazarev/numbers_and_words/issues/58)\] \([@mafraba](https://github.com/mafraba)\) \(assignee: [@eLod](https://github.com/eLod)\)
81
-
82
- ## 0.6.0 (March 25, 2013)
83
-
84
- ### Features
85
- * Support fractional form for Ukranian. \[[#54](https://github.com/kslazarev/numbers_and_words/issues/54)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@Shk-Serji](https://github.com/Shk-Serji)\)
86
- * Support fractional form for Russian. \[[#53](https://github.com/kslazarev/numbers_and_words/issues/53)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
87
- * Added functionality for spanish . \[[#51](https://github.com/kslazarev/numbers_and_words/pull/51)\] \([@jaambros](https://github.com/jaambros)\) \(assignee: [@jaambros](https://github.com/jaambros)\)
88
- * Support ordinal form for English and Hungarian. \[[#50](https://github.com/kslazarev/numbers_and_words/issues/50)\] \([@eLod](https://github.com/eLod)\) \(assignee: [@eLod](https://github.com/eLod)\)
89
- * Add option :remove_hyphen for English language. \[[#45](https://github.com/kslazarev/numbers_and_words/issues/45)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
90
- * Add option :hundreds_with_union for English language. \[[#44](https://github.com/kslazarev/numbers_and_words/issues/44)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
91
- * Add Spanish language. (experimental). \[[#42](https://github.com/kslazarev/numbers_and_words/issues/42)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
92
- * Add Swedish language. (experimental). \[[#41](https://github.com/kslazarev/numbers_and_words/issues/41)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
93
- * Add Hungarian language. \[[#40](https://github.com/kslazarev/numbers_and_words/pull/40)\] \([@eLod](https://github.com/eLod)\) \(assignee: [@eLod](https://github.com/eLod)\)
94
- * Add option :gender for Russian language. \[[#39](https://github.com/kslazarev/numbers_and_words/issues/39)\] \([@ermolaev](https://github.com/ermolaev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
95
- * Gem numbers_and_words not working for decimal values. \[[#38](https://github.com/kslazarev/numbers_and_words/issues/38)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@eLod](https://github.com/eLod)\)
96
-
97
- ### Supports
98
- * Update 'code climate' badge. \[[#47](https://github.com/kslazarev/numbers_and_words/issues/47)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
99
- * Add @eLog contacts and project description on Hungarian language to README. \[[#46](https://github.com/kslazarev/numbers_and_words/issues/46)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@eLod](https://github.com/eLod)\)
100
- * Add language specific options. \[[#43](https://github.com/kslazarev/numbers_and_words/issues/43)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
101
-
102
- ## 0.5.0 (October 19, 2012)
103
-
104
- ### Features
105
- * Add Italian language. (experimental). \[[#34](https://github.com/kslazarev/numbers_and_words/issues/34)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
106
- * Add Dutch language. (experimental). \[[#33](https://github.com/kslazarev/numbers_and_words/issues/33)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
107
- * Add French language. \[[#29](https://github.com/kslazarev/numbers_and_words/pull/29)\] \([@sorich87](https://github.com/sorich87)\) \(assignee: [@sorich87](https://github.com/sorich87)\)
108
-
109
- ### Supports
110
- * Add @sorich87 contacts to README. \[[#36](https://github.com/kslazarev/numbers_and_words/issues/36)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@sorich87](https://github.com/sorich87)\)
111
- * Add Code Climate badge. \[[#35](https://github.com/kslazarev/numbers_and_words/issues/35)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
112
- * Refactoring tests. \[[#32](https://github.com/kslazarev/numbers_and_words/issues/32)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
113
- * Refactoring strategies. \[[#31](https://github.com/kslazarev/numbers_and_words/issues/31)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
114
-
115
- ## 0.4.0 (June 24, 2012)
116
-
117
- ### Features
118
- * Add Turkish language. \[[#26](https://github.com/kslazarev/numbers_and_words/issues/26)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@Shk-Serji](https://github.com/Shk-Serji)\)
119
- * Add Ukrainian language. \[[#25](https://github.com/kslazarev/numbers_and_words/issues/25)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@Shk-Serji](https://github.com/Shk-Serji)\)
120
-
121
- ### Supports
122
- * Combine all connections with i18n library in one sub-module. \[[#28](https://github.com/kslazarev/numbers_and_words/issues/28)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
123
- * Add separate logics for pluralization in different languages. \[[#27](https://github.com/kslazarev/numbers_and_words/issues/27)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
124
-
125
- ## 0.3.2 (June 24, 2012)
126
-
127
- ### Bugs
128
- * Ломает плюрализацию russian. \[[#22](https://github.com/kslazarev/numbers_and_words/issues/22)\] \([@yura](https://github.com/yura)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
129
-
130
- ## 0.3.1 (May 04, 2012)
131
-
132
- ### Bugs
133
- * Fixes 80 in English. \[[#18](https://github.com/kslazarev/numbers_and_words/pull/18)\] \([@dblock](https://github.com/dblock)\) \(assignee: [@dblock](https://github.com/dblock)\)
134
-
135
- ### Supports
136
- * Add CHANGELOG.md. \[[#19](https://github.com/kslazarev/numbers_and_words/issues/19)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
137
- * Readable specs. \[[#16](https://github.com/kslazarev/numbers_and_words/pull/16)\] \([@dblock](https://github.com/dblock)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
138
-
139
- ### Deprecations
140
- * Add deprecation warning for using gem 'number_to_words_ru' . \[[#21](https://github.com/kslazarev/numbers_and_words/issues/21)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
141
-
142
- ## 0.3.0 (March 24, 2012)
143
-
144
- ### Bugs
145
- * Rails 3 will choke on a nested array. \[[#10](https://github.com/kslazarev/numbers_and_words/pull/10)\] \([@dblock](https://github.com/dblock)\) \(assignee: [@dblock](https://github.com/dblock)\)
146
- * English fixes and tests. \[[#9](https://github.com/kslazarev/numbers_and_words/pull/9)\] \([@dblock](https://github.com/dblock)\) \(assignee: [@dblock](https://github.com/dblock)\)
147
- * Namespaced NumbersAndWords. \[[#7](https://github.com/kslazarev/numbers_and_words/pull/7)\] \([@dblock](https://github.com/dblock)\) \(assignee: [@dblock](https://github.com/dblock)\)
148
-
149
- ### Supports
150
- * Add contacts to README. \[[#14](https://github.com/kslazarev/numbers_and_words/issues/14)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@dblock](https://github.com/dblock)\)
151
- * Fixed typo in readme. \[[#13](https://github.com/kslazarev/numbers_and_words/pull/13)\] \([@dblock](https://github.com/dblock)\) \(assignee: [@dblock](https://github.com/dblock)\)
152
- * Added Travis-ci. \[[#12](https://github.com/kslazarev/numbers_and_words/pull/12)\] \([@dblock](https://github.com/dblock)\) \(assignee: [@dblock](https://github.com/dblock)\)
153
- * Fix README (Russian & English). \[[#11](https://github.com/kslazarev/numbers_and_words/pull/11)\] \([@dblock](https://github.com/dblock)\) \(assignee: [@dblock](https://github.com/dblock)\)
154
- * Rename the repo at https://github.com/kslazarev/number_to_words_ru. \[[#8](https://github.com/kslazarev/numbers_and_words/issues/8)\] \([@dblock](https://github.com/dblock)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
155
- * Switch a hard-coded gemspec to Jeweler. \[[#6](https://github.com/kslazarev/numbers_and_words/pull/6)\] \([@dblock](https://github.com/dblock)\) \(assignee: [@dblock](https://github.com/dblock)\)
156
-
157
- ## 0.3.0.alpha (March 24, 2012)
158
-
159
- ### Features
160
- * Check working with ruby 1.9.3. \[[#4](https://github.com/kslazarev/numbers_and_words/issues/4)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
161
-
162
- ### Bugs
163
- * Bundle exec rake problem. \[[#3](https://github.com/kslazarev/numbers_and_words/issues/3)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
164
-
165
- ### Supports
166
- * Remove temporary file Gemfile.lock. \[[#5](https://github.com/kslazarev/numbers_and_words/issues/5)\] \([@kslazarev](https://github.com/kslazarev)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)
167
- * Renamed gem from number_to_words_ru to numbers_and_words. \[[#2](https://github.com/kslazarev/numbers_and_words/pull/2)\] \([@dblock](https://github.com/dblock)\) \(assignee: [@kslazarev](https://github.com/kslazarev)\)