summaryrefslogtreecommitdiff
path: root/app/serializers/cohort_activity_month_entity.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/cohort_activity_month_entity.rb')
-rw-r--r--app/serializers/cohort_activity_month_entity.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/serializers/cohort_activity_month_entity.rb b/app/serializers/cohort_activity_month_entity.rb
new file mode 100644
index 00000000000..e6788a8b596
--- /dev/null
+++ b/app/serializers/cohort_activity_month_entity.rb
@@ -0,0 +1,11 @@
+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