From c8a6711d681d4cce4be46a8346e69c6b184e6cf6 Mon Sep 17 00:00:00 2001 From: Stephen Pike Date: Thu, 19 Apr 2012 15:35:14 -0400 Subject: # Force result of Fixnum division to Fixnum The mathn library overrides Fixnum division to return a rational, so `1/2 => (1/2)` instead of `1/2 => 0`. Axslx calls chr on the result of Fixnum division, which is incompatible. Fix it by forcing to integer. --- lib/axlsx.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/axlsx.rb b/lib/axlsx.rb index 46d1c9bf..6fce32b5 100644 --- a/lib/axlsx.rb +++ b/lib/axlsx.rb @@ -71,7 +71,7 @@ module Axlsx chars = [] while index >= 26 do chars << ((index % 26) + 65).chr - index = index / 26 - 1 + index = (index / 26).to_i - 1 end chars << (index + 65).chr chars.reverse.join -- cgit v1.2.3