summaryrefslogtreecommitdiff
path: root/app/serializers/cohort_activity_month_entity.rb
blob: cdbc89a2dcd14d2d2328c75e8f2a14bc7c88b213 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

class CohortActivityMonthEntity < Grape::Entity
  include ActionView::Helpers::NumberHelper

  expose :total do |cohort_activity_month|
    number_with_delimiter(cohort_activity_month[:total])
  end

  expose :percentage do |cohort_activity_month|
    number_to_percentage(cohort_activity_month[:percentage], precision: 0)
  end
end