chris_lib 2.0.4 → 2.0.5

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
  SHA256:
3
- metadata.gz: 8b45dbc0752ee9fc958854c36c5fb37d68a2e87d7d575236f58dd4ae008951be
4
- data.tar.gz: 00b55b5fe70a3277f68d596b2e8a0e66345e299e25f6b57bc09812da2ee5be99
3
+ metadata.gz: a8e589ae062b5ed85189108754fbaa7d9cbb19b45edced9a8d2fbdf5bca295a2
4
+ data.tar.gz: 321eec2a967da2a904da7909109182087c3317d14ace9c546a5b3ea8156fb773
5
5
  SHA512:
6
- metadata.gz: 64af2078226120ddcc5cb13958d37b67a4cf1bfbff3d387d87f3e849f71e8ddde6bd73b008e0cf88154b25ff93024813449e4b34afd0d1bcc4e4b95610070964
7
- data.tar.gz: f846766e5724775c53901c10c8b081ac5ca035fea1a88e4e1c1ea1702493488b6a16781e7d53a98ba0810f758692f73b6a7f9ec8590db6473f665b45c65ef047
6
+ metadata.gz: ddae70fc4078288c6dc7b5db4f0027eeac0247001d490c85ba5300a58a14cd7aa34b4dfb81b4f8a822a26c5f1dd5ee6e2284c5511c68f5186460bd6e9c64c55a
7
+ data.tar.gz: 81fc5296ba1bd6a8cec244f378fb35312ae7e1deeff4d52da6c822b5a23bb20a450ef7f49ed9aa63270f390f8ae6093c90f0d881580ed63c2548b75be99ebfcb
@@ -36,6 +36,10 @@ Array.class_eval do
36
36
  def round(decimal_points = 0)
37
37
  map { |e| e.round(decimal_points) }
38
38
  end
39
+
40
+ def eround(decimal_points = 0)
41
+ map { |e| e.eround(decimal_points) }
42
+ end
39
43
 
40
44
  # mean of array
41
45
  def mean
@@ -80,6 +84,11 @@ Array.class_eval do
80
84
  end
81
85
 
82
86
  Float.class_eval do
87
+ # rounds exponential notation to n decimal places
88
+ def eround(decimal_points = 0)
89
+ ("%.#{decimal_points}e" % self).to_f
90
+ end
91
+
83
92
  def round_down(n=0)
84
93
  # n is decimal place to round down at
85
94
  int,dec=self.to_s.split('.')
@@ -1,3 +1,3 @@
1
1
  module ChrisLib
2
- VERSION = "2.0.4"
2
+ VERSION = "2.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chris_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-23 00:00:00.000000000 Z
11
+ date: 2022-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -38,6 +38,26 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: actionpack
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 6.1.4
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 6.1.4.2
51
+ type: :runtime
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: 6.1.4
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 6.1.4.2
41
61
  - !ruby/object:Gem::Dependency
42
62
  name: rspec
43
63
  requirement: !ruby/object:Gem::Requirement