From: Brad Date: 2003-12-31T23:26:47+09:00 Subject: Overriding to_s All: This is probably going to seem a bit silly, however I will ask anyway. :) Is there a way to override the to_s method such that it takes a parameter? For example, if I wanted to provide a format specifier for a number: class Numeric def to_s(optFormat) if !optFormat.nil? # format a string based on the optFormat format # specifier. retVal = format_number(self,optFormat) else retVal = self.to_s end retVal end end payment=600 # $6.00 puts(payment.to_s('$#.##')) (* not a perfect specimen of a ruby script, but it gets the idea across *) Any help with this matter, is greatly appreciated. :) Regards, Brad