Browse files

bug fix for data with all same y vals

  • Loading branch information...
1 parent d8a5103 commit 128d7c7afabee9c99f633c15f6344befd1f19694 @benlund committed Jun 15, 2011
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/ascii_charts.rb
View
10 lib/ascii_charts.rb
@@ -60,9 +60,13 @@ def step_size
STEPS = [1, 2, 5]
def from_step(val)
- order = Math.log10(val).floor.to_i
- num = (val / (10 ** order))
- [num, order]
+ if 0 == val
+ [0, 0]
+ else
+ order = Math.log10(val).floor.to_i
+ num = (val / (10 ** order))
+ [num, order]
+ end
end
def to_step(num, order)

0 comments on commit 128d7c7

Please sign in to comment.