From: Tim Hunter Date: 2008-01-06T04:11:38+09:00 Subject: Re: Convert bignum to numeric and formatting Damaris Fuentes wrote: > Hi you all, > > I'm trying to format a Bignum such as 1012345556 into 1.012.345.556 > (separating the thousands). Leaving aside the Numeric extension for a minute, this bit of code solves the problem. x = 12345678901234 t = x.to_s.reverse.gsub(/(\d){3}(?=\d)/) {|p| p + '.'}.reverse puts t I've seen other regexp solutions to this problem on this list, but the above code is what I came up with on the spur of the moment. -- RMagick: http://rmagick.rubyforge.org/ RMagick 2: http://rmagick.rubyforge.org/rmagick2.html