Permalink
Browse files

small fix on zero division

  • Loading branch information...
prikha committed Jun 6, 2012
1 parent 60bfe9d commit f5098443aba86fc59b02eace6ecad7530d72694b
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/gruff/base.rb
View
@@ -1066,7 +1066,7 @@ def increment_color
# 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)

0 comments on commit f509844

Please sign in to comment.