From: Tom Copeland Date: 2003-08-06T01:59:30+09:00 Subject: Re: format number with comma separators? On Tue, 2003-08-05 at 12:07, Warren Brown wrote: > If you want to allow a decimal point: > > irb(main):001:0> puts "-123456789.01".gsub(/(\d)(?=\d{3}+(\.\d*)?$)/, '\1,') > -123,456,789.01 > > - Warren Brown Immortalized here: http://rubyforge.org/snippet/detail.php?type=snippet&id=8 Yours, tom