shopify-money 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/money/money.rb +6 -3
- data/lib/money/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae2953d70e905d5f2425b6c334f5e8a920ec749a0e82341739b90dee7c446254
|
4
|
+
data.tar.gz: 42fd32e212f52fb97c366cc39fe8bf462fff7be09ebb54690a6c7a3d80e5c08d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 538545671ca1a88fd930f5148b0477a2558a6166764439a2a30ff3a7b34f7057fbf510c11f238d44cae13296c2eb81cfd07ffa510bfacae2b8780c49920404ed
|
7
|
+
data.tar.gz: 67944f9355d6b02e61c0e90f9e34cfd3ec7d3adea2f6dfbb45fc88241e38af516ad89726bd13b2e4a211e4adb26741f842904f92095e678808e1e25b871abfde
|
data/lib/money/money.rb
CHANGED
@@ -232,9 +232,12 @@ class Money
|
|
232
232
|
if units == 0
|
233
233
|
sprintf("%d", rounded_value)
|
234
234
|
else
|
235
|
-
|
236
|
-
|
237
|
-
|
235
|
+
formatted = rounded_value.to_s("F")
|
236
|
+
decimal_digits = formatted.size - formatted.index(".") - 1
|
237
|
+
(units - decimal_digits).times do
|
238
|
+
formatted << '0'
|
239
|
+
end
|
240
|
+
formatted
|
238
241
|
end
|
239
242
|
end
|
240
243
|
alias_method :to_s, :to_fs
|
data/lib/money/version.rb
CHANGED