<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -240,7 +240,8 @@ class RRDB
       create_database(time, safe_data.keys)
     end
     params = fields.map do |f|
-      safe_data[f].send(safe_data[f].to_s =~ /\A\d+\./ ? :to_f : :to_i)
+      digits = safe_data[f].to_s.delete(&quot;^0-9.&quot;)
+      digits.send(digits.include?(&quot;.&quot;) ? :to_f : :to_i)
     end
     rrdtool(:update, &quot;'#{time.to_i}:#{params.join(':')}'&quot;)
   end</diff>
      <filename>lib/rrdb.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,6 +48,23 @@ class TestFetch &lt; Test::Unit::TestCase
     end
   end
   
+  def test_all_fields_are_converted_to_numbers
+    RRDB.config( :reserve_fields       =&gt; 0,
+                 :database_start       =&gt; Time.at(920804400),
+                 :data_sources         =&gt; { :comma =&gt; &quot;GAUGE:600:U:U&quot;,
+                                            :kb    =&gt; &quot;GAUGE:600:U:U&quot; },
+                 :round_robin_archives =&gt; %w[AVERAGE:0.5:1:24] )
+    
+    @db.update(Time.at(920804700), :comma =&gt; &quot;17,000&quot;, :kb =&gt; &quot;10 kb&quot;)
+    @db.update(Time.at(920805000), :comma =&gt; &quot;17,000&quot;, :kb =&gt; &quot;10 kb&quot;)
+    
+    values = @db.fetch( :AVERAGE,
+                       :start =&gt; Time.at(920804700),
+                       :end   =&gt; Time.at(920804700) ).values.first
+    assert_equal(17_000, values[&quot;comma&quot;])
+    assert_equal(10,     values[&quot;kb&quot;])
+  end
+  
   def test_floats_are_supported
     RRDB.config( :reserve_fields       =&gt; 0,
                  :database_start       =&gt; Time.at(920804400),</diff>
      <filename>test/tc_fetch.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>aea997aff6465e9579200a2e53a109d71fc1fdf0</id>
    </parent>
  </parents>
  <author>
    <name>James Edward Gray II</name>
    <email>james@graysoftinc.com</email>
  </author>
  <url>http://github.com/JEG2/rrdb/commit/fe6d2fbda6ac57b9d685cf3a47468ef90f866988</url>
  <id>fe6d2fbda6ac57b9d685cf3a47468ef90f866988</id>
  <committed-date>2008-07-21T07:40:15-07:00</committed-date>
  <authored-date>2008-07-21T07:40:15-07:00</authored-date>
  <message>Fixing number field conversions.</message>
  <tree>7f619c6bfd8d2be2d7a0e4b4611246e9b8c2ef4b</tree>
  <committer>
    <name>James Edward Gray II</name>
    <email>james@graysoftinc.com</email>
  </committer>
</commit>
