projects
/
booh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32fad0d
)
*** empty log message ***
author
gc
<gc>
Wed, 5 Mar 2008 22:58:29 +0000
(22:58 +0000)
committer
gc
<gc>
Wed, 5 Mar 2008 22:58:29 +0000
(22:58 +0000)
lib/booh/booh-lib.rb
patch
|
blob
|
history
diff --git
a/lib/booh/booh-lib.rb
b/lib/booh/booh-lib.rb
index
bef8574
..
252547e
100644
(file)
--- a/
lib/booh/booh-lib.rb
+++ b/
lib/booh/booh-lib.rb
@@
-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