src/vsphere_cpi/lib/cloud/vsphere/resources/util.rb
# Returns the average value from a given CSV string.
#
# @param [String] csv CSV string of integers/floats.
# @return [Numeric] average value
Returns the average value from a given CSV string.
Returns the average value from a given CSV string .
def average_csv(csv)
          values = csv.split(",")
          result = 0
          return result if values.empty?
          values.each { |v| result += v.to_f }
          result / values.size
        end
def average_csv ( csv ) values = csv . split ( "," ) result = 0 return result if values . empty? values . each { | v | result += v . to_f } result / values . size end
Returns the average value from a given CSV string.
Returns the average value from a given CSV string .
None
Numeric
csv
csv CSV string of integers/floats.
csv CSV string of integers / floats .