You are viewing a single comment's thread. Return to all comments →
def serial_average(number) num1, num2, num3 = number.split("-") avg = ((num2.to_f + num3.to_f) / 2).round(2) new_number = "#{num1}-%0.2f" % [avg] return new_number end
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby - Strings - Indexing
You are viewing a single comment's thread. Return to all comments →