numbers_and_words_pl 0.0.2 → 0.0.3
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_pl/helper.rb +10 -3
- data/lib/numbers_and_words_pl/version.rb +1 -1
- data/spec/pl.yml +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 381428b4ed48473d7a03337bc63953e812ed14f1
|
4
|
+
data.tar.gz: 22ad5d11fce89abd276c939c05351bc49b4c894f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b0dd9ec8ed24d5427049498b3b57cec4c30447ea7e7c4cf0a689ce772eb1441b51c7780720cc53657a58feeee981aeb5ba25ec3dcc0e064d789fb3fde9c583f
|
7
|
+
data.tar.gz: f73c8d55d94958a60f048971e96f36d6b916c760f833247bec3e5720d338e3308cb21f356afe288c3037725f2e693d82e7f04cdb9b6da4eb4c699e703a64fdd2
|
@@ -17,11 +17,18 @@ module NumbersAndWordsPl
|
|
17
17
|
"#{PL_NUMBERS['hundreds'][hundreds]} #{to_words_pl rest if rest > 0}".strip
|
18
18
|
when 1_000..999_999
|
19
19
|
thousands = integer.to_s[0..-4].to_i
|
20
|
-
one_few_many =
|
20
|
+
one_few_many = case thousands
|
21
|
+
when 1
|
22
|
+
'one'
|
23
|
+
when 2..4
|
24
|
+
'few'
|
25
|
+
else
|
26
|
+
'many'
|
27
|
+
end
|
21
28
|
rest = integer.to_s[-3..-1].to_i
|
22
|
-
"#{to_words_pl thousands
|
29
|
+
"#{to_words_pl thousands} #{PL_NUMBERS['thousands'][one_few_many]} #{to_words_pl rest if rest > 0}".strip
|
23
30
|
else
|
24
|
-
|
31
|
+
raise "number #{integer} not supported"
|
25
32
|
end
|
26
33
|
end
|
27
34
|
end
|
data/spec/pl.yml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: numbers_and_words_pl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Lang
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-05-
|
12
|
+
date: 2017-05-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|