show transaction distribution in euro's

This commit is contained in:
Felix Van der Jeugt 2015-09-14 15:14:09 +02:00
parent 54b8e8808b
commit 6a86a418eb

View file

@ -24,7 +24,7 @@ class Statistics < Rails::Application
end end
def amount_distribution 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}) hash.merge({10 * group.to_i => count})
end end
end end