From: Josselin Date: 2006-10-11T22:45:12+09:00 Subject: Re: help with regex On 2006-10-11 15:18:05 +0200, Peter Szinek said: > Hello, > > My first shot at this: > > def to_nice_number(n) > frags = n.scan(/\d+/) > return n if frags.size == 1 #the trivial case "9999" > last_part = frags.pop > frags.join + "." + last_part > end > > Peter > http://www.rubyrailways.com Thanks Peter... actually I don't have yet the 'ruby way'... using scan , pop !! that's it I tested in all cases and it works ...... I also register your RSS