checkpercentage 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/spec/lib/checksomething.rb +18 -0
- metadata +2 -2
- data/lib/checksomething.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bf647d8acfaafc10105730ddb139d3c88230a92
|
4
|
+
data.tar.gz: 21d9d050578de63f7385a071ff456849ac2e6c0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8920401be775f49407bd22d292a3e2cef9da0633230b17da5189e3fb9d30355b61cea343110d9097d21c04041e0cc1f897fd3b6dcd6a8d0cdce2740eb345979
|
7
|
+
data.tar.gz: 8ac56af17c24e370c1c161af8341375294c985caa0686caa6c8baf445c17f3a5ca27d7912ce6c4a5da4f73cde772192a4b046495484064f7b59970058d115804
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class Checkpercentage
|
2
|
+
|
3
|
+
#1) what is x% of y?
|
4
|
+
def findAmount(rate, base)
|
5
|
+
rate * base/100
|
6
|
+
end
|
7
|
+
|
8
|
+
#2) x is what percentage of y?
|
9
|
+
def findPercent(amount, base)
|
10
|
+
amount/base * 100
|
11
|
+
end
|
12
|
+
|
13
|
+
#3) x is y% of what number?
|
14
|
+
def findBase(amount, rate)
|
15
|
+
amount/rate * 100
|
16
|
+
end
|
17
|
+
|
18
|
+
end # End Module
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: checkpercentage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Zacchi
|
@@ -16,7 +16,7 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
-
- lib/checksomething.rb
|
19
|
+
- spec/lib/checksomething.rb
|
20
20
|
homepage: http://rubygems.org/gems/checkpercentage
|
21
21
|
licenses: []
|
22
22
|
metadata: {}
|
data/lib/checksomething.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
class Checkpercentage
|
2
|
-
|
3
|
-
#1) what is x% of y?
|
4
|
-
def self.findAmount(rate, base)
|
5
|
-
resultAmount = rate * base/100
|
6
|
-
return resultAmount
|
7
|
-
end
|
8
|
-
|
9
|
-
#2) x is what percentage of y?
|
10
|
-
def self.findPercent(amount, base )
|
11
|
-
resultPercent = amount/base * 100
|
12
|
-
return resultPercent
|
13
|
-
end
|
14
|
-
|
15
|
-
#3) x is y% of what number?
|
16
|
-
def self.findBase(amount, rate)
|
17
|
-
resultBase amount/rate *100
|
18
|
-
end
|
19
|
-
|
20
|
-
end # End Module
|