class SpreeReports::Helper

Public Class Methods

date_formatted(date, group_by) click to toggle source
# File lib/spree_reports/helper.rb, line 14
def self.date_formatted(date, group_by)
  date_format = SpreeReports.date_formats[group_by]
  date.strftime(date_format)
end
divide(a, b) click to toggle source
# File lib/spree_reports/helper.rb, line 4
def self.divide(a, b)
  return nil if b == 0
  a / b
end
round(a) click to toggle source
# File lib/spree_reports/helper.rb, line 9
def self.round(a)
  return a.round(2) if a
  a
end