Description: Fix division by zero errors with Ruby1.9
Author: Serge Prikha <prikha@gmail.com>
Origin: https://github.com/prikha/gruff/commit/f5098443aba86fc59b02eace6ecad7530d72694b
Reviewed-by: Cédric Boutillier <cedric.boutillier@gmail.com>
Applied-Upstream: yes
Bug: https://github.com/topfunky/gruff/issues/21
Bug-Debian: http://bugs.debian.org/676206
Last-Update: 2012-06-06


---
 lib/gruff/base.rb |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/lib/gruff/base.rb
+++ b/lib/gruff/base.rb
@@ -1062,7 +1062,7 @@
     # Return a formatted string representing a number value that should be
     # printed as a label.
     def label(value)
-      label = if (@spread.to_f % @marker_count.to_f == 0) || !@y_axis_increment.nil?
+      label = if (@spread.to_f % (@marker_count.to_f==0 ? 1 : @marker_count.to_f) == 0) || !@y_axis_increment.nil?
         value.to_i.to_s
       elsif @spread > 10.0
         sprintf("%0i", value)
