numbers_and_words 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/README.rdoc +90 -1
- data/lib/numbers_and_words.rb +4 -3
- data/lib/numbers_and_words/core_ext.rb +1 -0
- data/lib/numbers_and_words/core_ext/array.rb +1 -1
- data/lib/numbers_and_words/core_ext/float.rb +5 -0
- data/lib/numbers_and_words/core_ext/integer.rb +2 -9
- data/lib/numbers_and_words/helper_classes.rb +2 -0
- data/lib/numbers_and_words/helper_classes/array_extensions/helpers.rb +81 -0
- data/lib/numbers_and_words/helper_classes/array_extensions/validations.rb +19 -0
- data/lib/numbers_and_words/helper_classes/figures_array.rb +18 -0
- data/lib/numbers_and_words/helper_classes/words_array.rb +11 -0
- data/lib/numbers_and_words/i18n/locales/numbers.en.yml +48 -0
- data/lib/numbers_and_words/i18n/locales/numbers.es.yml +15 -0
- data/lib/numbers_and_words/i18n/locales/numbers.hu.yml +16 -0
- data/lib/numbers_and_words/i18n/locales/numbers.ru.yml +27 -3
- data/lib/numbers_and_words/i18n/locales/numbers.se.yml +7 -0
- data/lib/numbers_and_words/i18n/locales/numbers.ua.yml +14 -2
- data/lib/numbers_and_words/i18n/pluralization.rb +1 -0
- data/lib/numbers_and_words/i18n/plurals/es.rb +11 -0
- data/lib/numbers_and_words/strategies.rb +16 -11
- data/lib/numbers_and_words/strategies/array_joiner.rb +31 -0
- data/lib/numbers_and_words/strategies/figures_converter.rb +33 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators.rb +39 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/base.rb +18 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en.rb +3 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en/base.rb +12 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en/fractional.rb +38 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/en/integral.rb +12 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/hu.rb +3 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/base.rb +12 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/fractional.rb +38 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/hu/integral.rb +12 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ru.rb +3 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/base.rb +12 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/fractional.rb +39 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ru/integral.rb +27 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ua.rb +3 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/base.rb +12 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/fractional.rb +39 -0
- data/lib/numbers_and_words/strategies/figures_converter/decorators/ua/integral.rb +27 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages.rb +39 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/base.rb +29 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/en.rb +48 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/es.rb +37 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/families/base.rb +77 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/families/cyrillic.rb +34 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/families/helpers.rb +36 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/families/latin.rb +13 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/fr.rb +37 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/hu.rb +63 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/it.rb +11 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/nl.rb +26 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/ru.rb +11 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/se.rb +11 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/tr.rb +11 -0
- data/lib/numbers_and_words/strategies/figures_converter/languages/ua.rb +11 -0
- data/lib/numbers_and_words/strategies/figures_converter/options.rb +41 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en.rb +4 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en/hundreds_with_union.rb +33 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en/ordinal.rb +60 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en/remove_hyphen.rb +29 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/en/remove_zero.rb +29 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/hu.rb +1 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/hu/ordinal.rb +60 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/ru.rb +1 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/ru/gender.rb +28 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/ua.rb +1 -0
- data/lib/numbers_and_words/strategies/figures_converter/options/ua/gender.rb +28 -0
- data/lib/numbers_and_words/translations.rb +25 -0
- data/lib/numbers_and_words/{translations_helpers → translations}/base.rb +2 -2
- data/lib/numbers_and_words/translations/en.rb +8 -0
- data/lib/numbers_and_words/translations/es.rb +37 -0
- data/lib/numbers_and_words/translations/extensions/fraction_significance.rb +25 -0
- data/lib/numbers_and_words/translations/families/base.rb +33 -0
- data/lib/numbers_and_words/translations/families/cyrillic.rb +29 -0
- data/lib/numbers_and_words/translations/families/latin.rb +23 -0
- data/lib/numbers_and_words/translations/fr.rb +29 -0
- data/lib/numbers_and_words/translations/hu.rb +26 -0
- data/lib/numbers_and_words/translations/it.rb +15 -0
- data/lib/numbers_and_words/translations/nl.rb +15 -0
- data/lib/numbers_and_words/translations/ru.rb +25 -0
- data/lib/numbers_and_words/translations/se.rb +11 -0
- data/lib/numbers_and_words/translations/tr.rb +11 -0
- data/lib/numbers_and_words/translations/ua.rb +21 -0
- data/lib/numbers_and_words/version.rb +1 -1
- data/lib/numbers_and_words/wrappers.rb +2 -0
- data/lib/numbers_and_words/wrappers/float.rb +60 -0
- data/lib/numbers_and_words/wrappers/integer.rb +21 -0
- metadata +81 -44
- data/lib/numbers_and_words/array_additions.rb +0 -2
- data/lib/numbers_and_words/array_additions/helpers.rb +0 -44
- data/lib/numbers_and_words/array_additions/validations.rb +0 -9
- data/lib/numbers_and_words/figures_array.rb +0 -15
- data/lib/numbers_and_words/strategies/base.rb +0 -18
- data/lib/numbers_and_words/strategies/en.rb +0 -8
- data/lib/numbers_and_words/strategies/families/base.rb +0 -71
- data/lib/numbers_and_words/strategies/families/cyrillic.rb +0 -18
- data/lib/numbers_and_words/strategies/families/latin.rb +0 -9
- data/lib/numbers_and_words/strategies/fr.rb +0 -32
- data/lib/numbers_and_words/strategies/it.rb +0 -8
- data/lib/numbers_and_words/strategies/nl.rb +0 -23
- data/lib/numbers_and_words/strategies/ru.rb +0 -8
- data/lib/numbers_and_words/strategies/tr.rb +0 -8
- data/lib/numbers_and_words/strategies/ua.rb +0 -8
- data/lib/numbers_and_words/translations_helpers.rb +0 -11
- data/lib/numbers_and_words/translations_helpers/en.rb +0 -12
- data/lib/numbers_and_words/translations_helpers/families/base.rb +0 -30
- data/lib/numbers_and_words/translations_helpers/families/cyrillic.rb +0 -28
- data/lib/numbers_and_words/translations_helpers/families/latin.rb +0 -23
- data/lib/numbers_and_words/translations_helpers/fr.rb +0 -34
- data/lib/numbers_and_words/translations_helpers/it.rb +0 -16
- data/lib/numbers_and_words/translations_helpers/nl.rb +0 -18
- data/lib/numbers_and_words/translations_helpers/ru.rb +0 -8
- data/lib/numbers_and_words/translations_helpers/tr.rb +0 -8
- data/lib/numbers_and_words/translations_helpers/ua.rb +0 -8
@@ -0,0 +1,15 @@
|
|
1
|
+
es:
|
2
|
+
numbers:
|
3
|
+
ones: [cero, uno, dos, tres, cuatro, cinco, seis, siete, ocho, nueve]
|
4
|
+
one: un
|
5
|
+
|
6
|
+
teens: [diez, once, doce, trece, catorce, quince, dieciseis, diecisiete, dieciocho, diecinueve]
|
7
|
+
tens: [cero, diez, veinti, treinta, cuarenta, cincuenta, sesenta, setenta, ochenta, noventa]
|
8
|
+
twenty: veinte
|
9
|
+
|
10
|
+
hundreds: [ciento, doscientos, trescientos, cuatrocientos, quinientos, seiscientos, setecientos, ochocientos, novecientos]
|
11
|
+
one_hundred: cien
|
12
|
+
|
13
|
+
mega: [ones, mil, millón, millardo, billón, billardo, trillón, trillardo, quadrillón, quadrillardo, quintillón, quintillardo]
|
14
|
+
megas: [ones, mil, millones, millardos, billones, billardos, trillones, trillardos, quadrillones, quadrillardos, quintillones, quintillardos]
|
15
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
hu:
|
2
|
+
numbers:
|
3
|
+
ones: [nulla, egy, kettő, három, négy, öt, hat, hét, nyolc, kilenc]
|
4
|
+
ones_with_tens: [nulla, egy, kettő, három, négy, öt, hat, hét, nyolc, kilenc]
|
5
|
+
tens: [nulla, tíz, húsz, harminc, negyven, ötven, hatvan, hetven, nyolcvan, kilencven]
|
6
|
+
tens_with_ones: [nulla, tizen, huszon, harminc, negyven, ötven, hatvan, hetven, nyolcvan, kilencven]
|
7
|
+
hundreds: száz
|
8
|
+
mega: [egy, ezer, millió, milliárd, billió, billiárd, trillió, trilliárd, kvadrillió, kvadrilliárd, kvintillió, kvintilliárd]
|
9
|
+
union: egész
|
10
|
+
ordinal:
|
11
|
+
ones: [nulladik, első, második, harmadik, negyedik, ötödik, hatodik, hetedik, nyolcadik, kilencedik]
|
12
|
+
ones_with_tens: [nulladik, egyedik, kettedik, harmadik, negyedik, ötödik, hatodik, hetedik, nyolcadik, kilencedik]
|
13
|
+
tens: [nulladik, tizedik, huszadik, harmincadik, negyvenedik, ötvenedik, hatvanadik, hetvenedik, nyolcvanadik, kilencvenedik]
|
14
|
+
hundreds: századik
|
15
|
+
mega: [nulladik, ezredik, milliomodik, milliárdodik, billiomodik, billiárdodik, trilliomodik, trilliárdodik, kvadrilliomodik, kvadrilliárdodik, kvintilliomodik, kvintilliárdodik]
|
16
|
+
micro: [_, tized, század, ezred, milliomod, milliárdod, billiomod, billiárdod, trilliomod, trilliárdod, kvadrilliomod, kvadrilliárdod, kvintilliomod, kvintilliárdod]
|
@@ -1,10 +1,22 @@
|
|
1
1
|
ru:
|
2
2
|
numbers:
|
3
|
-
|
4
|
-
|
3
|
+
ones:
|
4
|
+
male: [ноль, один, два, три, четыре, пять, шесть, семь, восемь, девять]
|
5
|
+
female: [ноль, одна, двe, три, четыре, пять, шесть, семь, восемь, девять]
|
6
|
+
neuter: [ноль, одно, два, три, четыре, пять, шесть, семь, восемь, девять]
|
5
7
|
teens: [десять, одиннадцать, двенадцать, тринадцать, четырнадцать, пятнадцать, шестнадцать, семнадцать, восемнадцать, девятнадцать]
|
6
8
|
tens: [ноль, десять, двадцать, тридцать, сорок, пятьдесят, шестьдесят, семьдесят, восемьдесят, девяносто]
|
7
9
|
hundreds: [ноль, сто, двести, триста, четыреста, пятьсот, шестьсот, семьсот, восемьсот, девятьсот]
|
10
|
+
union: 'и'
|
11
|
+
micro:
|
12
|
+
one: [_, десятая, сотая, тысячная, миллионная, миллиардная, триллионная]
|
13
|
+
few: [_, десятых, сотых, тысячных, миллионных, миллиардных, триллионных]
|
14
|
+
many: [_, десятых, сотых, тысячных, миллионных, миллиардных, триллионных]
|
15
|
+
sub_micro: [_, десяти, сто]
|
16
|
+
integral:
|
17
|
+
one: целая
|
18
|
+
few: целых
|
19
|
+
many: целых
|
8
20
|
thousands:
|
9
21
|
one: тысяча
|
10
22
|
few: тысячи
|
@@ -49,4 +61,16 @@ ru:
|
|
49
61
|
one: дециллион
|
50
62
|
few: дециллиона
|
51
63
|
many: дециллионов
|
52
|
-
mega:
|
64
|
+
mega:
|
65
|
+
- ones
|
66
|
+
- thousands
|
67
|
+
- millions
|
68
|
+
- billions
|
69
|
+
- trillions
|
70
|
+
- quadrillions
|
71
|
+
- quintillion
|
72
|
+
- sextillions
|
73
|
+
- septillions
|
74
|
+
- octillions
|
75
|
+
- nonillions
|
76
|
+
- decillions
|
@@ -0,0 +1,7 @@
|
|
1
|
+
se:
|
2
|
+
numbers:
|
3
|
+
ones: [noll, en, två, tre, fyra, fem, sex, sju, åtta, nio]
|
4
|
+
teens: [tio, elva, tolv, tretton, fjorton, femton, sexton, sjutton, arton, nitton]
|
5
|
+
tens: [noll, tio, tjugo, trettio, fyrtio, femtio, sextio, sjuttio, åttio, nittio]
|
6
|
+
hundreds: hundra
|
7
|
+
mega: [ett, tusen, miljoner, miljarder, biljoner, kvadriljon, kvintiljon, sextillion, septillion, octillion, nonillion, decillion]
|
@@ -1,10 +1,22 @@
|
|
1
1
|
ua:
|
2
2
|
numbers:
|
3
|
-
|
4
|
-
|
3
|
+
ones:
|
4
|
+
male: [нуль, один, два, три, чотири, п’ять, шiсть, сiм, вiсiм, дев’ять]
|
5
|
+
female: [нуль, одна, двi, три, чотири, п’ять, шiсть, сiм, вiсiм, дев’ять]
|
6
|
+
neuter: [нуль, одне, два, три, чотири, п’ять, шiсть, сiм, вiсiм, дев’ять]
|
5
7
|
teens: [десять, одинадцять, дванадцять, тринадцять, чотирнадцять, п’ятнадцять, шiстнадцять, сiмнадцять, вiсiмнадцять, дев’ятнадцять]
|
6
8
|
tens: [нуль, десять, двадцять, тридцять, сорок, п’ятдесят, шiстдесят, сiмдесят, вiсiмдесят, дев’яносто]
|
7
9
|
hundreds: [нуль, сто, двiстi, триста, чотириста, п’ятсот, шiстсот, сiмсот, вiсiмсот, дев’ятсот]
|
10
|
+
union: 'i'
|
11
|
+
micro:
|
12
|
+
one: [_, десята, сота, тысячна, мiльйонна, мiльярдна, трильйонна]
|
13
|
+
few: [_, десятих, сотих, тисячних, мiльйонних, мiльярдних, трильйонних]
|
14
|
+
many: [_, десятих, сотих, тисячних, мiльйонних, мiльярдних, трильйонних]
|
15
|
+
sub_micro: [_, десяти, сто]
|
16
|
+
integral:
|
17
|
+
one: цiла
|
18
|
+
few: цiлих
|
19
|
+
many: цiлих
|
8
20
|
thousands:
|
9
21
|
one: тисяча
|
10
22
|
few: тисячi
|
@@ -1,11 +1,16 @@
|
|
1
|
-
require 'numbers_and_words/strategies/
|
2
|
-
require 'numbers_and_words/strategies/
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
require 'numbers_and_words/strategies/figures_converter'
|
2
|
+
require 'numbers_and_words/strategies/array_joiner'
|
3
|
+
|
4
|
+
module NumbersAndWords
|
5
|
+
module Strategies
|
6
|
+
class << self
|
7
|
+
def figures_converter
|
8
|
+
FiguresConverter::Base
|
9
|
+
end
|
10
|
+
|
11
|
+
def array_joiner
|
12
|
+
ArrayJoiner::Base
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module NumbersAndWords
|
2
|
+
module Strategies
|
3
|
+
module ArrayJoiner
|
4
|
+
class Base
|
5
|
+
|
6
|
+
attr_accessor :options, :elements
|
7
|
+
|
8
|
+
def initialize elements, options = {}
|
9
|
+
@elements = elements
|
10
|
+
@options = options
|
11
|
+
@translations = Translations.factory
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
around { elements.join union_separator }
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def union_separator
|
21
|
+
separator = options[:union_separator] || @translations.union || ''
|
22
|
+
" #{separator} " if separator.present?
|
23
|
+
end
|
24
|
+
|
25
|
+
def around
|
26
|
+
yield
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'numbers_and_words/strategies/figures_converter/languages'
|
2
|
+
require 'numbers_and_words/strategies/figures_converter/options'
|
3
|
+
require 'numbers_and_words/strategies/figures_converter/decorators'
|
4
|
+
|
5
|
+
module NumbersAndWords
|
6
|
+
module Strategies
|
7
|
+
module FiguresConverter
|
8
|
+
class Base
|
9
|
+
|
10
|
+
attr_accessor :options, :figures, :translations, :language, :decorator
|
11
|
+
|
12
|
+
def initialize figures, options = {}
|
13
|
+
@figures = figures.reverse
|
14
|
+
|
15
|
+
@decorator = Decorators.factory(self, options)
|
16
|
+
@options = Options::Proxy.new(self, options)
|
17
|
+
@translations = Translations.factory
|
18
|
+
@language = Languages.factory(self)
|
19
|
+
end
|
20
|
+
|
21
|
+
def run
|
22
|
+
around { language.words }
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def around
|
28
|
+
decorator.run { yield }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'numbers_and_words/strategies/figures_converter/decorators/base'
|
2
|
+
require 'numbers_and_words/strategies/figures_converter/decorators/en'
|
3
|
+
require 'numbers_and_words/strategies/figures_converter/decorators/ru'
|
4
|
+
require 'numbers_and_words/strategies/figures_converter/decorators/hu'
|
5
|
+
require 'numbers_and_words/strategies/figures_converter/decorators/ua'
|
6
|
+
|
7
|
+
module NumbersAndWords
|
8
|
+
module Strategies
|
9
|
+
module FiguresConverter
|
10
|
+
module Decorators
|
11
|
+
class << self
|
12
|
+
AVAILABLE = [:integral, :fractional]
|
13
|
+
|
14
|
+
def factory strategy, options
|
15
|
+
enabled_decorator(options).new strategy, options
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def enabled_decorator options
|
21
|
+
decorator_class AVAILABLE.select { |name| !options[name].nil? }.first
|
22
|
+
end
|
23
|
+
|
24
|
+
def decorator_class method_name
|
25
|
+
method_name ? decorator_class_name(method_name).constantize : Decorators::Base
|
26
|
+
end
|
27
|
+
|
28
|
+
def decorator_class_name method_name
|
29
|
+
"#{name}::#{language_class_name}::#{method_name.to_s.camelcase}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def language_class_name
|
33
|
+
::I18n.locale.to_s.titleize.gsub ' ', '::'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module NumbersAndWords
|
2
|
+
module Strategies
|
3
|
+
module FiguresConverter
|
4
|
+
module Decorators
|
5
|
+
class Base
|
6
|
+
def initialize strategy, options
|
7
|
+
@strategy = strategy
|
8
|
+
@options = options
|
9
|
+
end
|
10
|
+
|
11
|
+
def run
|
12
|
+
yield
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module NumbersAndWords
|
2
|
+
module Strategies
|
3
|
+
module FiguresConverter
|
4
|
+
module Decorators
|
5
|
+
module En
|
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.reverse.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
|
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,38 @@
|
|
1
|
+
module NumbersAndWords
|
2
|
+
module Strategies
|
3
|
+
module FiguresConverter
|
4
|
+
module Decorators
|
5
|
+
module Hu
|
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.reverse.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
|
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
|