From 6a86a418eb16ab223713724cbe8dc9451252bc83 Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Mon, 14 Sep 2015 15:14:09 +0200 Subject: [PATCH] show transaction distribution in euro's --- app/controllers/concerns/statistics.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/statistics.rb b/app/controllers/concerns/statistics.rb index d2c835a..a560f18 100644 --- a/app/controllers/concerns/statistics.rb +++ b/app/controllers/concerns/statistics.rb @@ -24,7 +24,7 @@ class Statistics < Rails::Application end def amount_distribution - Transaction.group("round(amount / 10)").count.inject(Hash.new) do |hash, (group, count)| + Transaction.group("round(amount / 1000, 2)").count.inject(Hash.new) do |hash, (group, count)| hash.merge({10 * group.to_i => count}) end end