*** empty log message ***
authorgc <gc>
Wed, 5 Mar 2008 22:58:29 +0000 (22:58 +0000)
committergc <gc>
Wed, 5 Mar 2008 22:58:29 +0000 (22:58 +0000)
lib/booh/booh-lib.rb

index bef857491bd5452ffcd40f5f031e44dd24e38894..252547ecbd6da8d536e96670614126a584024ae0 100644 (file)
@@ -259,7 +259,8 @@ module Booh
     def commify(n)
         n.to_s =~ /([^\.]*)(\..*)?/
         int, dec = $1.reverse, $2 ? $2 : ""
-        while int.gsub!(/(,|\.|^)(\d{3})(\d)/, '\1\2' + _(",") + '\3')
+        sep = _(",")
+        while int.gsub!(/(#{Regexp.quote(sep)}|\.|^)(\d{3})(\d)/, '\1\2' + sep + '\3')
         end
         int.reverse + dec
     end