Skip to content
This repository
Browse code

Merge pull request #19 from vicvega/master

Fixed float maths
  • Loading branch information...
commit 777cd05efbcbea2418cefe766b25da9f805167a9 2 parents 508a80d + e998e49
Geoffrey Grosenbach authored January 18, 2012

Showing 1 changed file with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. 11  lib/gruff/base.rb
11  lib/gruff/base.rb
@@ -699,8 +699,8 @@ def draw_line_markers
699 699
         @d = @d.fill(@marker_color)
700 700
         @d = @d.line(@graph_left, y, @graph_right, y)
701 701
 
702  
-        marker_label = (BigDecimal(index.to_s) * BigDecimal(@increment.to_s) +
703  
-                        BigDecimal(@minimum_value.to_s)).to_f
  702
+        marker_label = BigDecimal(index.to_s) * BigDecimal(@increment.to_s) +
  703
+                       BigDecimal(@minimum_value.to_s)
704 704
 
705 705
         unless @hide_line_numbers
706 706
           @d.fill = @font_color
@@ -979,9 +979,10 @@ def min(data_point, index) # :nodoc:
979 979
       data_point
980 980
     end
981 981
 
982  
-    def significant(inc) # :nodoc:
983  
-      return 1.0 if inc == 0 # Keep from going into infinite loop
984  
-      factor = 1.0
  982
+    def significant(i) # :nodoc:
  983
+      return 1.0 if i == 0 # Keep from going into infinite loop
  984
+      inc = BigDecimal(i.to_s)
  985
+      factor = BigDecimal('1.0')
985 986
       while (inc < 10)
986 987
         inc *= 10
987 988
         factor /= 10

0 notes on commit 777cd05

Please sign in to comment.
Something went wrong with that request. Please try again.