istox 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/istox/helpers/f_math.rb +4 -4
- data/lib/istox/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: e744a42229dc85a16fba77b03ac23b602c990e887468b26cad8d1918027bd590
|
4
|
+
data.tar.gz: 36919909f41cfc6dc4c49f8c2295e2712d654220c05675136231746daf78fca3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42c9c0b13d5ab66674162cd23248c0211f3101727118fd658464ca1d3513bdee25bb81679675186043e4e75b8cb98e344406a4d2fb5d73de1730ff41c15e2f72
|
7
|
+
data.tar.gz: cc87304361314598728938cf1649f7afd1436944fa8dba2f7e581084eecc8899f70f881519bd52a3fe2b4f19df7f8a2cbec71f4c56654503ecbc4c1ff44cab95
|
data/lib/istox/helpers/f_math.rb
CHANGED
@@ -80,11 +80,11 @@ module Istox
|
|
80
80
|
::BigDecimal.new(x.to_s).round(digits).to_s
|
81
81
|
end
|
82
82
|
|
83
|
-
# rounding mechanism can be
|
83
|
+
# rounding mechanism can be 'down', 'up', or 'natural'
|
84
84
|
# by default will be :down
|
85
|
-
def round(x, digits, rounding_mechanism:
|
86
|
-
return round_up(x, digits) if rounding_mechanism ==
|
87
|
-
return round_half_up(x, digits) if rounding_mechanism ==
|
85
|
+
def round(x, digits, rounding_mechanism: 'down')
|
86
|
+
return round_up(x, digits) if rounding_mechanism == 'up'
|
87
|
+
return round_half_up(x, digits) if rounding_mechanism == 'natural'
|
88
88
|
|
89
89
|
round_down(x, digits)
|
90
90
|
end
|
data/lib/istox/version.rb
CHANGED