Files
game-data/src/helpers.rb
T
gballan 1e0cd49cf8
ci/woodpecker/push/woodpecker Pipeline was successful
Added ability to add benchmark results from hardware page
2024-02-09 13:57:01 -05:00

22 lines
344 B
Ruby

# frozen_string_literal: true
# Helpers - view helper functions
module Helpers
def date_format(date)
dt = date.to_datetime
return dt.strftime('%B %d, %Y @ %I:%M:%S %p %Z')
end
def average_array(arr, decimals = 1)
sum = 0
arr.each do |i|
sum += i
end
return (sum / arr.length).round(decimals)
end
end