From: Craig Demyanovich Date: 2008-05-08T03:37:27+09:00 Subject: Re: hash adding values ------=_Part_827_12942495.1210185437828 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Something like this? >> h = Hash.new( [] ) => {} >> h["a"] << 2.2 => [2.2] >> h["a"] << 3 => [2.2, 3] >> sum_of_a = 0.0 => 0.0 >> h["a"].inject { |sum_of_a, value| sum_of_a += value } => 5.2 >> sum_of_a => 5.2 I have no idea if that's the best way to do that; I'm still earning my Ruby chops. Regards, Craig ------=_Part_827_12942495.1210185437828--