>> [25, 150, 200, 5, 75, 125].percentages_of_maximum => [12, 75, 100, 2, 37, 62]
If you're using Rails, stick this in your "environment.rb" script in the "config" directory:
class Array def percentages_of_maximum self.collect{ |i| ((i.to_f / self.sort.last.to_f) * 100).to_i } end end