<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -14,7 +14,7 @@ class Statement &lt; ActiveRecord::Base
 
   def ending_balance=(amount)
     if amount.is_a?(Float) || amount =~ /[.,]/
-      amount = (amount.to_s.tr(&quot;,&quot;, &quot;&quot;).to_f * 100).to_i
+      amount = (amount.to_s.tr(&quot;,&quot;, &quot;&quot;).to_f * 100).round
     end
 
     super(amount)</diff>
      <filename>app/models/statement.rb</filename>
    </modified>
    <modified>
      <diff>@@ -77,4 +77,9 @@ class StatementTest &lt; ActiveSupport::TestCase
       :cleared =&gt; statements(:john).account_items.map(&amp;:id)
     assert !statements(:john).balanced?(true)
   end
+  
+  test &quot;ending_balance should not have truncation errors&quot; do
+    statements(:john).update_attribute :ending_balance, 2557.68
+    assert statements(:john).ending_balance == 255768
+  end
 end</diff>
      <filename>test/unit/statement_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>73bacab445326b7b3f21a43ec294863e293b1013</id>
    </parent>
  </parents>
  <author>
    <name>Cody Maggard</name>
    <email>cody.maggard@gmail.com</email>
  </author>
  <url>http://github.com/jamis/bucketwise/commit/1186f62e002b8bafadb5412adfdf44ff9583ab05</url>
  <id>1186f62e002b8bafadb5412adfdf44ff9583ab05</id>
  <committed-date>2009-05-25T21:03:49-07:00</committed-date>
  <authored-date>2009-05-18T00:45:06-07:00</authored-date>
  <message>Fix for jamis/bucketwise#17 (truncation errors)</message>
  <tree>9913fb309335e8b7267aa7251655eafd4b5746d0</tree>
  <committer>
    <name>Jamis Buck</name>
    <email>jamis@37signals.com</email>
  </committer>
</commit>
