Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bug fix for data with all same y vals

  • Loading branch information...
commit 128d7c7afabee9c99f633c15f6344befd1f19694 1 parent d8a5103
@benlund authored
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)
Please sign in to comment.
Something went wrong with that request. Please try again.