*** 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 bef8574..252547e 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