Skip to content

Commit

Permalink
small fix on zero division
Browse files Browse the repository at this point in the history
  • Loading branch information
prikha committed Jun 6, 2012
1 parent 60bfe9d commit f509844
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/gruff/base.rb
Expand Up @@ -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)
Expand Down

0 comments on commit f509844

Please sign in to comment.