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