mark_facets 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/mark_facets/ruby/math.rb +6 -0
  2. metadata +4 -4
@@ -15,5 +15,11 @@ module Math
15
15
  def self.max(a, b)
16
16
  a > b ? a : b
17
17
  end
18
+
19
+ def self.percentage(n1, n2)
20
+ return 0 if n2 == 0 || n1 == 0
21
+ p = ((n2.to_f / n1.to_f) * 100)
22
+ return p
23
+ end
18
24
 
19
25
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - markbates
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-16 00:00:00 -05:00
17
+ date: 2010-12-11 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -74,7 +74,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - ">="
76
76
  - !ruby/object:Gem::Version
77
- hash: -2448770046756531736
77
+ hash: 3231506291172207564
78
78
  segments:
79
79
  - 0
80
80
  version: "0"