SyntaxFix
Write A Post
Hire A Developer
Questions
You could try something like the following:
a = [1,2,3,4,5] # => [1, 2, 3, 4, 5] (a.sum/a.length).to_f # => 3.0