From: Arfin Date: 2005-03-23T06:09:50+09:00 Subject: Any guides for good coding in Ruby? Is there some kind of class to format numbers? Something to let you transform: 1 => "0001" 1234 => "1,234.00" I needed to display the day and month in a 00 format and the way I did it was adding a method to the Integer class class Integer def addZero return "0" + self.to_s if self.to_s.length == 1 return self.to_s end end t = Time.now p "The date is: #{t.year}#{t.month.addZero}#{t.day.addZero}" What do you guys think of this solution? On a side note, could you guys give a few rules of thumb you follow in order to make your code clean and readable?