Conversion to an int vector and average calculation