checkpercentage 0.1.2 → 0.1.3
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 +9 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 268c1c3653bf454e1921772f6d1d1905af81b3fc
|
4
|
+
data.tar.gz: 7c772fe0f7b72b84e2b5c71fe2ca176548033d1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f3f380927487d8bb25184ad40fba93a61d0cc9d7f9ed45603fa9729399b3bf3d3896685142fbb4f61d76448fbe3e3fdfef0129a1fb6d09c8637d453e79551ce
|
7
|
+
data.tar.gz: 3ab13c5d085ea4eea1b44f3b2ab7571c3ab94e87ca8425d457ca071fae95dfb2ba4072a64df11e6106df6d5f1885383fd11e841a3ec2334ad5077100d48b1e75
|
data/spec/lib/checksomething.rb
CHANGED
@@ -1,18 +1,21 @@
|
|
1
1
|
class Checkpercentage
|
2
2
|
|
3
3
|
#1) what is x% of y?
|
4
|
-
def
|
5
|
-
rate * base/100
|
4
|
+
def self.find_amount(rate, base)
|
5
|
+
result_amount = rate * base/100
|
6
|
+
return result_amount
|
6
7
|
end
|
7
8
|
|
8
9
|
#2) x is what percentage of y?
|
9
|
-
def
|
10
|
-
amount/base * 100
|
10
|
+
def self.find_percent(amount, base)
|
11
|
+
result_percent = amount/base * 100
|
12
|
+
return result_percent
|
11
13
|
end
|
12
14
|
|
13
15
|
#3) x is y% of what number?
|
14
|
-
def
|
15
|
-
|
16
|
+
def self.find_base(amount, rate)
|
17
|
+
result_base = amount/rate * 100
|
18
|
+
return result_base
|
16
19
|
end
|
17
20
|
|
18
21
|
end # End Module
|