money 3.5.2 → 3.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +7 -0
- data/lib/money/money.rb +2 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/lib/money/money.rb
CHANGED
@@ -907,7 +907,8 @@ class Money
|
|
907
907
|
else
|
908
908
|
Math.log10(currency.subunit_to_unit).to_s.to_i+1
|
909
909
|
end
|
910
|
-
unit, subunit = cents.divmod(currency.subunit_to_unit).map{|o| o.to_s}
|
910
|
+
unit, subunit = cents.abs.divmod(currency.subunit_to_unit).map{|o| o.to_s}
|
911
|
+
unit = (unit.to_i * -1).to_s if cents < 0
|
911
912
|
return unit if decimal_places == 0
|
912
913
|
subunit = (("0" * decimal_places) + subunit)[(-1*decimal_places)..-1]
|
913
914
|
"#{unit}#{separator}#{subunit}"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: money
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 3.5.
|
9
|
+
- 3
|
10
|
+
version: 3.5.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tobias Luetke
|