From: "Brian Schröder" Date: 2005-05-12T21:38:17+09:00 Subject: Re: Standard Library patches - rational, delegate On 12/05/05, Luke Galea wrote: > I know I definately needed those rational methods for a meal planner I'm > working on.. > > One more thing that might be useful for rational.rb: a to_s method for > Rational that produces results for 3/2 as '1 1/2'.. Not sure what that would > best be called but I think it's a good change to bundle in there.. > Here we go: class Rational def however_its_called() self.divmod(1) end end easy, isn't it? regards, Brian Schr�der -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/