ascii_charts 0.9 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/ascii_charts.rb +8 -4
  2. metadata +3 -2
@@ -1,6 +1,6 @@
1
1
  module AsciiCharts
2
2
 
3
- VERSION = '0.9'
3
+ VERSION = '0.9.1'
4
4
 
5
5
  class Chart
6
6
 
@@ -60,9 +60,13 @@ module AsciiCharts
60
60
  STEPS = [1, 2, 5]
61
61
 
62
62
  def from_step(val)
63
- order = Math.log10(val).floor.to_i
64
- num = (val / (10 ** order))
65
- [num, order]
63
+ if 0 == val
64
+ [0, 0]
65
+ else
66
+ order = Math.log10(val).floor.to_i
67
+ num = (val / (10 ** order))
68
+ [num, order]
69
+ end
66
70
  end
67
71
 
68
72
  def to_step(num, order)
metadata CHANGED
@@ -5,7 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- version: "0.9"
8
+ - 1
9
+ version: 0.9.1
9
10
  platform: ruby
10
11
  authors:
11
12
  - Ben Lund
@@ -13,7 +14,7 @@ autorequire:
13
14
  bindir: bin
14
15
  cert_chain: []
15
16
 
16
- date: 2011-05-20 00:00:00 +01:00
17
+ date: 2011-06-15 00:00:00 +01:00
17
18
  default_executable:
18
19
  dependencies: []
19
20