big_decimal_helper 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5cb7c05e03c2b1f358615238f41469e36028278
|
4
|
+
data.tar.gz: 6844f77005261785f09eff876248b55ab87ac847
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d49cb19038faffc190e449d648654cb1e9513ae83329eb8f02c3f32a6b5cc90019a2c37b933d0cd4be97e5c22a200add2da2fc8346869a987edaa338777ecf6e
|
7
|
+
data.tar.gz: bff4c71cbe2834e0296ab62767e110e999c686011cd02cd8d15f8a90267cf85215367c357b1053d775bb46905ee7ed6dc0861ef0d44b43fd518394267f9f072e
|
@@ -13,6 +13,7 @@ module BigDecimalHelper
|
|
13
13
|
module ViaStringRepresentation
|
14
14
|
def to_bd
|
15
15
|
string_representation = to_s.gsub(/[^\-\d\.]/, '')
|
16
|
+
string_representation = "0" if string_representation =~ /^\s*$/ # convert blanks to zero
|
16
17
|
BigDecimal.new(string_representation)
|
17
18
|
end
|
18
19
|
end
|