numbers_and_words 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/numbers_and_words/core_ext/array.rb +2 -2
- data/lib/numbers_and_words/core_ext/float.rb +1 -1
- data/lib/numbers_and_words/core_ext/integer.rb +1 -1
- data/lib/numbers_and_words/helper_classes.rb +1 -1
- data/lib/numbers_and_words/helper_classes/array_extensions/helpers.rb +11 -12
- data/lib/numbers_and_words/helper_classes/figures_array.rb +1 -4
- data/lib/numbers_and_words/helper_classes/words_array.rb +2 -4
- data/lib/numbers_and_words/i18n.rb +4 -4
- data/lib/numbers_and_words/i18n/initialization.rb +2 -2
- data/lib/numbers_and_words/i18n/locales/numbers.en.yml +3 -3
- data/lib/numbers_and_words/i18n/locales/numbers.es.yml +86 -25
- data/lib/numbers_and_words/i18n/locales/numbers.fr.yml +54 -1
- data/lib/numbers_and_words/i18n/locales/numbers.pt-BR.yml +4 -4
- data/lib/numbers_and_words/i18n/locales/numbers.pt.yml +0 -1
- data/lib/numbers_and_words/i18n/pluralization.rb +2 -3
- data/lib/numbers_and_words/i18n/plurals/fr.rb +3 -3
- data/lib/numbers_and_words/i18n/plurals/lt.rb +11 -8
- data/lib/numbers_and_words/i18n/plurals/lv.rb +3 -3
- data/lib/numbers_and_words/i18n/plurals/ru.rb +15 -10
- data/lib/numbers_and_words/strategies.rb +1 -1
- data/lib/numbers_and_words/strategies/array_joiner.rb +1 -2
- data/lib/numbers_and_words/strategies/array_joiner/languages.rb +3 -1
- data/lib/numbers_and_words/strategies/array_joiner/languages/base.rb +1 -1
- data/lib/numbers_and_words/strategies/array_joiner/languages/es.rb +10 -0
- data/lib/numbers_and_words/strategies/array_joiner/languages/families/base.rb +0 -1
- data/lib/numbers_and_words/strategies/array_joiner/languages/fr.rb +10 -0
- data/lib/numbers_and_words/strategies/figures_converter.rb +1 -2
- data/lib/numbers_and_words/strategies/figures_converter/decorators.rb +8 -6
- data/lib/numbers_and_words/strategies/figures_converter/decorators/base.rb +2 -2
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en/base.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb +2 -3
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en/integral.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/decorators/es.rb +3 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/es/base.rb +12 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/es/fractional.rb +38 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/es/integral.rb +12 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/fr.rb +3 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/fr/base.rb +12 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/fr/fractional.rb +37 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/fr/integral.rb +12 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/hu.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/base.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/fractional.rb +2 -3
- data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/integral.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/decorators/pt-BR/fractional.rb +1 -2
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/base.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/fractional.rb +2 -3
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/integral.rb +1 -2
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/base.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/fractional.rb +2 -3
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/integral.rb +1 -2
- data/lib/numbers_and_words/strategies/figures_converter/languages.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/languages/base.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/languages/de.rb +9 -9
- data/lib/numbers_and_words/strategies/figures_converter/languages/en-GB.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/languages/en.rb +17 -19
- data/lib/numbers_and_words/strategies/figures_converter/languages/es.rb +50 -25
- data/lib/numbers_and_words/strategies/figures_converter/languages/et.rb +1 -2
- data/lib/numbers_and_words/strategies/figures_converter/languages/families/base.rb +5 -5
- data/lib/numbers_and_words/strategies/figures_converter/languages/families/cyrillic.rb +5 -5
- data/lib/numbers_and_words/strategies/figures_converter/languages/families/helpers.rb +10 -14
- data/lib/numbers_and_words/strategies/figures_converter/languages/fr.rb +7 -7
- data/lib/numbers_and_words/strategies/figures_converter/languages/hu.rb +8 -8
- data/lib/numbers_and_words/strategies/figures_converter/languages/ka.rb +8 -10
- data/lib/numbers_and_words/strategies/figures_converter/languages/lt.rb +6 -6
- data/lib/numbers_and_words/strategies/figures_converter/languages/lv.rb +2 -2
- data/lib/numbers_and_words/strategies/figures_converter/languages/pt-BR.rb +24 -26
- data/lib/numbers_and_words/strategies/figures_converter/languages/pt.rb +6 -7
- data/lib/numbers_and_words/strategies/figures_converter/languages/tr.rb +4 -4
- data/lib/numbers_and_words/strategies/figures_converter/options.rb +6 -5
- data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/hundreds_with_union.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/ordinal.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/remove_hyphen.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/options/en-GB/remove_zero.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/options/en/hundreds_with_union.rb +3 -3
- data/lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb +3 -3
- data/lib/numbers_and_words/strategies/figures_converter/options/en/pronounced.rb +14 -23
- data/lib/numbers_and_words/strategies/figures_converter/options/en/remove_hyphen.rb +2 -3
- data/lib/numbers_and_words/strategies/figures_converter/options/en/remove_zero.rb +2 -2
- data/lib/numbers_and_words/strategies/figures_converter/options/es.rb +3 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/es/apocopated.rb +28 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/es/gender.rb +28 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/es/remove_zero.rb +28 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/hu/ordinal.rb +3 -3
- data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR/gender.rb +2 -2
- data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR/ordinal.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/options/pt-BR/remove_zero.rb +1 -1
- data/lib/numbers_and_words/strategies/figures_converter/options/ru/gender.rb +2 -2
- data/lib/numbers_and_words/strategies/figures_converter/options/ua/gender.rb +2 -2
- data/lib/numbers_and_words/translations/base.rb +2 -2
- data/lib/numbers_and_words/translations/de.rb +5 -5
- data/lib/numbers_and_words/translations/es.rb +29 -24
- data/lib/numbers_and_words/translations/et.rb +3 -3
- data/lib/numbers_and_words/translations/extensions/fraction_significance.rb +4 -5
- data/lib/numbers_and_words/translations/families/base.rb +8 -8
- data/lib/numbers_and_words/translations/families/cyrillic.rb +6 -6
- data/lib/numbers_and_words/translations/families/latin.rb +6 -6
- data/lib/numbers_and_words/translations/fr.rb +16 -8
- data/lib/numbers_and_words/translations/hu.rb +3 -3
- data/lib/numbers_and_words/translations/it.rb +3 -3
- data/lib/numbers_and_words/translations/ka.rb +13 -13
- data/lib/numbers_and_words/translations/lt.rb +4 -5
- data/lib/numbers_and_words/translations/lv.rb +4 -5
- data/lib/numbers_and_words/translations/nl.rb +3 -3
- data/lib/numbers_and_words/translations/pt-BR.rb +18 -18
- data/lib/numbers_and_words/translations/pt.rb +4 -5
- data/lib/numbers_and_words/translations/ru.rb +5 -5
- data/lib/numbers_and_words/translations/se.rb +2 -2
- data/lib/numbers_and_words/translations/tr.rb +3 -4
- data/lib/numbers_and_words/translations/ua.rb +3 -3
- data/lib/numbers_and_words/version.rb +1 -1
- data/lib/numbers_and_words/wrappers.rb +1 -1
- data/lib/numbers_and_words/wrappers/float.rb +9 -9
- data/lib/numbers_and_words/wrappers/integer.rb +3 -3
- metadata +16 -4
- data/lib/numbers_and_words/helper_classes/array_extensions/validations.rb +0 -19
- data/lib/numbers_and_words/i18n/plurals/pt-BR.rb +0 -15
@@ -6,37 +6,30 @@ module NumbersAndWords
|
|
6
6
|
class Pronounced
|
7
7
|
attr_accessor :strategy, :options
|
8
8
|
|
9
|
-
def initialize
|
9
|
+
def initialize(proxy, *_args)
|
10
10
|
@strategy = proxy.strategy
|
11
11
|
@options = proxy.options
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
def result
|
16
|
-
active? ? 'PRONOUNCED' : 'NOTPRONOUNCED'
|
17
|
-
end
|
18
|
-
|
19
14
|
def active?
|
20
15
|
@options[:pronounced]
|
21
16
|
end
|
22
17
|
|
23
|
-
def process
|
24
|
-
if figures.
|
25
|
-
language.number_without_capacity_to_words + language.complex_number_to_words
|
26
|
-
elsif figures.capacity_count
|
18
|
+
def process(language, figures)
|
19
|
+
if figures.capacity_count
|
27
20
|
handle_thousands language, figures
|
28
21
|
elsif figures.hundreds
|
29
22
|
handle_hundreds language, figures
|
30
|
-
elsif figures.tens
|
23
|
+
elsif figures.tens || figures.ones
|
31
24
|
language.simple_number_to_words
|
32
25
|
else
|
33
26
|
[]
|
34
27
|
end
|
35
28
|
end
|
36
29
|
|
37
|
-
def handle_thousands
|
30
|
+
def handle_thousands(language, figures)
|
38
31
|
_units, _tens, hundreds, thousands = *figures.to_a.dup
|
39
|
-
if hundreds
|
32
|
+
if hundreds.zero?
|
40
33
|
language.number_without_capacity_to_words + language.complex_number_to_words
|
41
34
|
else
|
42
35
|
result = tens_with_oh language, figures
|
@@ -44,28 +37,26 @@ module NumbersAndWords
|
|
44
37
|
end
|
45
38
|
end
|
46
39
|
|
47
|
-
def handle_hundreds
|
40
|
+
def handle_hundreds(language, figures)
|
48
41
|
_units, _tens, hundreds = *figures.to_a.dup
|
49
42
|
result = tens_with_oh language, figures
|
50
43
|
result.push hundreds.to_words
|
51
44
|
end
|
52
45
|
|
53
|
-
def tens_with_oh
|
46
|
+
def tens_with_oh(language, figures)
|
54
47
|
units, tens = *figures.to_a.dup
|
55
48
|
result = []
|
56
|
-
if tens
|
57
|
-
if units
|
49
|
+
if tens.zero?
|
50
|
+
if units.zero?
|
58
51
|
result.push 'hundred'
|
59
52
|
else
|
60
53
|
result.push language.ones
|
61
54
|
result.push 'oh'
|
62
55
|
end
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
result.push language.complex_tens
|
68
|
-
end
|
56
|
+
elsif figures.teens
|
57
|
+
result.push language.teens
|
58
|
+
elsif figures.tens
|
59
|
+
result.push language.complex_tens
|
69
60
|
end
|
70
61
|
end
|
71
62
|
end
|
@@ -6,12 +6,11 @@ module NumbersAndWords
|
|
6
6
|
class RemoveHyphen
|
7
7
|
attr_accessor :strategy, :options
|
8
8
|
|
9
|
-
def initialize
|
9
|
+
def initialize(proxy, *_args)
|
10
10
|
@strategy = proxy.strategy
|
11
11
|
@options = proxy.options
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
14
|
def result
|
16
15
|
active? ? ' ' : '-'
|
17
16
|
end
|
@@ -26,4 +25,4 @@ module NumbersAndWords
|
|
26
25
|
end
|
27
26
|
end
|
28
27
|
end
|
29
|
-
end
|
28
|
+
end
|
@@ -6,7 +6,7 @@ module NumbersAndWords
|
|
6
6
|
class RemoveZero
|
7
7
|
attr_accessor :strategy, :options
|
8
8
|
|
9
|
-
def initialize
|
9
|
+
def initialize(proxy, *_args)
|
10
10
|
@strategy = proxy.strategy
|
11
11
|
@options = proxy.options
|
12
12
|
end
|
@@ -25,4 +25,4 @@ module NumbersAndWords
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
28
|
-
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module NumbersAndWords
|
2
|
+
module Strategies
|
3
|
+
module FiguresConverter
|
4
|
+
module Options
|
5
|
+
module Es
|
6
|
+
class Apocopated
|
7
|
+
attr_accessor :strategy, :options
|
8
|
+
|
9
|
+
def initialize(proxy, *_args)
|
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[:apocopated]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module NumbersAndWords
|
2
|
+
module Strategies
|
3
|
+
module FiguresConverter
|
4
|
+
module Options
|
5
|
+
module Es
|
6
|
+
class Gender
|
7
|
+
attr_accessor :strategy, :options
|
8
|
+
|
9
|
+
def initialize(proxy, *_args)
|
10
|
+
@strategy = proxy.strategy
|
11
|
+
@options = proxy.options
|
12
|
+
end
|
13
|
+
|
14
|
+
def result
|
15
|
+
active? ? @options[:gender].to_sym : :male
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def active?
|
21
|
+
@options[:gender]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module NumbersAndWords
|
2
|
+
module Strategies
|
3
|
+
module FiguresConverter
|
4
|
+
module Options
|
5
|
+
module Es
|
6
|
+
class RemoveZero
|
7
|
+
attr_accessor :strategy, :options
|
8
|
+
|
9
|
+
def initialize(proxy, *_args)
|
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
|
@@ -8,12 +8,12 @@ module NumbersAndWords
|
|
8
8
|
HUNDRED_TYPE = :hundreds
|
9
9
|
MEGS_TYPE = :megs
|
10
10
|
|
11
|
-
def initialize
|
11
|
+
def initialize(proxy, *_args)
|
12
12
|
@strategy = proxy.strategy
|
13
13
|
@options = proxy.options
|
14
14
|
end
|
15
15
|
|
16
|
-
def result
|
16
|
+
def result(type)
|
17
17
|
@type = type
|
18
18
|
MEGS_TYPE != type ? check_simple_numbers : check_megs_numbers
|
19
19
|
end
|
@@ -57,4 +57,4 @@ module NumbersAndWords
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
60
|
-
end
|
60
|
+
end
|
@@ -6,14 +6,14 @@ module NumbersAndWords
|
|
6
6
|
class Gender
|
7
7
|
attr_accessor :strategy, :options
|
8
8
|
|
9
|
-
def initialize
|
9
|
+
def initialize(proxy, *_args)
|
10
10
|
@strategy = proxy.strategy
|
11
11
|
@options = proxy.options
|
12
12
|
end
|
13
13
|
|
14
14
|
def result
|
15
15
|
gender = active? ? @options[:gender].to_sym : :male
|
16
|
-
[
|
16
|
+
%i[male female].include?(gender) ? gender : :male
|
17
17
|
end
|
18
18
|
|
19
19
|
private
|
@@ -6,7 +6,7 @@ module NumbersAndWords
|
|
6
6
|
class Gender
|
7
7
|
attr_accessor :strategy, :options
|
8
8
|
|
9
|
-
def initialize
|
9
|
+
def initialize(proxy, *_args)
|
10
10
|
@strategy = proxy.strategy
|
11
11
|
@options = proxy.options
|
12
12
|
end
|
@@ -25,4 +25,4 @@ module NumbersAndWords
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
28
|
-
end
|
28
|
+
end
|
@@ -6,7 +6,7 @@ module NumbersAndWords
|
|
6
6
|
class Gender
|
7
7
|
attr_accessor :strategy, :options
|
8
8
|
|
9
|
-
def initialize
|
9
|
+
def initialize(proxy, *_args)
|
10
10
|
@strategy = proxy.strategy
|
11
11
|
@options = proxy.options
|
12
12
|
end
|
@@ -25,4 +25,4 @@ module NumbersAndWords
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
28
|
-
end
|
28
|
+
end
|
@@ -3,8 +3,8 @@ module NumbersAndWords
|
|
3
3
|
class Base
|
4
4
|
I18N_NAMESPACE = :numbers
|
5
5
|
|
6
|
-
def t
|
7
|
-
::I18n.t attribute, options.merge(:
|
6
|
+
def t(attribute, options = {})
|
7
|
+
::I18n.t attribute, options.merge(scope: I18N_NAMESPACE)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -4,21 +4,21 @@ module NumbersAndWords
|
|
4
4
|
include NumbersAndWords::Translations::Families::Latin
|
5
5
|
DEFAULT_POSTFIX = :combine
|
6
6
|
|
7
|
-
def ones
|
7
|
+
def ones(number, options = {})
|
8
8
|
t([options[:prefix], :ones, options[:postfix] || DEFAULT_POSTFIX].join('.'))[number]
|
9
9
|
end
|
10
10
|
|
11
|
-
def tens_with_ones
|
11
|
+
def tens_with_ones(numbers, options = {})
|
12
12
|
[tens(numbers[1]), ones(numbers[0], options)].reverse.join 'und'
|
13
13
|
end
|
14
14
|
|
15
|
-
def hundreds
|
15
|
+
def hundreds(number, _options = {})
|
16
16
|
[ones(number), t(:hundreds)].join('')
|
17
17
|
end
|
18
18
|
|
19
|
-
def zero
|
19
|
+
def zero(_options = {})
|
20
20
|
ones 0
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
@@ -2,43 +2,48 @@ module NumbersAndWords
|
|
2
2
|
module Translations
|
3
3
|
class Es < Base
|
4
4
|
include NumbersAndWords::Translations::Families::Latin
|
5
|
+
include NumbersAndWords::Translations::Extensions::FractionSignificance
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
def one
|
9
|
-
t(:one)
|
10
|
-
end
|
11
|
-
|
12
|
-
def ones(number, _options = {})
|
13
|
-
t(:ones)[number]
|
7
|
+
def zero(_options = {})
|
8
|
+
t(%i[ones male].join('.'))[0]
|
14
9
|
end
|
15
10
|
|
16
|
-
def
|
17
|
-
|
11
|
+
def ones(number, options = {})
|
12
|
+
return if options[:is_one_thousand]
|
13
|
+
return t(%i[ones apocopated].join('.')) if options[:is_apocopated]
|
14
|
+
t([:ones, options[:gender]].join('.'))[number]
|
18
15
|
end
|
19
16
|
|
20
|
-
def
|
21
|
-
t(
|
17
|
+
def twenties_with_ones(numbers, options = {})
|
18
|
+
return t(%i[twenties apocopated].join('.')) if options[:is_apocopated]
|
19
|
+
t([:twenties, options[:gender]].join('.'))[numbers[0]]
|
22
20
|
end
|
23
21
|
|
24
|
-
def
|
25
|
-
|
26
|
-
|
22
|
+
def tens_with_ones(numbers, options = {})
|
23
|
+
ones_number = if options[:is_apocopated] && numbers[0] == 1
|
24
|
+
t(%i[ones apocopated].join('.'))
|
25
|
+
else
|
26
|
+
t([:ones, options[:gender]].join('.'))[numbers[0]]
|
27
|
+
end
|
28
|
+
[tens(numbers[1], alone: false), t(:union), ones_number].join(' ')
|
27
29
|
end
|
28
30
|
|
29
|
-
def
|
30
|
-
|
31
|
-
|
32
|
-
[tens(numbers[1], alone: false), union, ones_number].join
|
31
|
+
def hundreds(number, options = {})
|
32
|
+
return t(%i[hundreds apocopated].join('.')) if options[:is_apocopated]
|
33
|
+
t([:hundreds, options[:gender]].join('.'))[number]
|
33
34
|
end
|
34
35
|
|
35
|
-
def
|
36
|
-
|
37
|
-
|
36
|
+
def micros(capacity, number = nil)
|
37
|
+
micro, prefix = capacity
|
38
|
+
micros = number ? t(micro(micro), count: number) : micro(micro)
|
39
|
+
[micro_prefix(prefix), micros].compact.join
|
38
40
|
end
|
39
41
|
|
40
|
-
def
|
41
|
-
|
42
|
+
def micro_prefix(capacity)
|
43
|
+
case capacity
|
44
|
+
when 2 then t('micro_prefix.hundreds')
|
45
|
+
when 1 then t('micro_prefix.tens')
|
46
|
+
end
|
42
47
|
end
|
43
48
|
end
|
44
49
|
end
|
@@ -3,11 +3,11 @@ module NumbersAndWords
|
|
3
3
|
class Et < Base
|
4
4
|
include NumbersAndWords::Translations::Families::Latin
|
5
5
|
|
6
|
-
def tens_with_ones
|
7
|
-
[tens(numbers[1], :
|
6
|
+
def tens_with_ones(numbers, _options = {})
|
7
|
+
[tens(numbers[1], alone: false), ones(numbers[0])].join ' '
|
8
8
|
end
|
9
9
|
|
10
|
-
def hundreds
|
10
|
+
def hundreds(number, options = {})
|
11
11
|
options[:separator] = ''
|
12
12
|
super number, options
|
13
13
|
end
|
@@ -2,18 +2,17 @@ module NumbersAndWords
|
|
2
2
|
module Translations
|
3
3
|
module Extensions
|
4
4
|
module FractionSignificance
|
5
|
-
|
6
|
-
def micros capacity, number = nil, separator = '-'
|
5
|
+
def micros(capacity, number = nil, separator = '-')
|
7
6
|
micro, prefix = capacity
|
8
|
-
micros = number ? t(micro(micro), :
|
7
|
+
micros = number ? t(micro(micro), count: number) : micro(micro)
|
9
8
|
[micro_prefix(prefix), micros].compact.join separator
|
10
9
|
end
|
11
10
|
|
12
|
-
def micro
|
11
|
+
def micro(capacity)
|
13
12
|
t(:micro)[capacity]
|
14
13
|
end
|
15
14
|
|
16
|
-
def micro_prefix
|
15
|
+
def micro_prefix(capacity)
|
17
16
|
case capacity
|
18
17
|
when 2 then t(:hundreds)
|
19
18
|
when 1 then tens(1)
|