diff --git a/lib/quickeebooks/shared/service/filter.rb b/lib/quickeebooks/shared/service/filter.rb
index <HASH>..<HASH> 100644
--- a/lib/quickeebooks/shared/service/filter.rb
+++ b/lib/quickeebooks/shared/service/filter.rb
@@ -89,7 +89,7 @@ module Quickeebooks
         end
 
         def text_to_xml
-          "<#{@field}>#{CGI::escapeHTML(@value)}</#{@field}>"
+          "<#{@field}>#{CGI::escapeHTML(@value.to_s)}</#{@field}>"
         end
 
         def boolean_to_s
diff --git a/spec/quickeebooks/shared/filter_spec.rb b/spec/quickeebooks/shared/filter_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/quickeebooks/shared/filter_spec.rb
+++ b/spec/quickeebooks/shared/filter_spec.rb
@@ -104,6 +104,12 @@ describe "Quickeebooks::Shared::Service::Filter" do
           :field => 'Foo',
           :value => "<3 Bar's ><things").to_xml.should == '<Foo>&lt;3 Bar\'s &gt;&lt;things</Foo>'
       end
+
+      it 'CGI escapes integers' do
+        filter.new(:text,
+          :field => 'Foo',
+          :value => 3).to_xml.should == '<Foo>3</Foo>'
+      end
     end
   end
CGI::escapeHTML fails for integers