From 47584180d8ed03666d45f423107d3113cc4a6230 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 1 Sep 2019 19:44:05 +0200 Subject: Fix wrong percentages in admin UI for hashtag usage breakdown (#11714) --- app/views/admin/tags/show.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/admin/tags/show.html.haml b/app/views/admin/tags/show.html.haml index c3779d48c..f9677874a 100644 --- a/app/views/admin/tags/show.html.haml +++ b/app/views/admin/tags/show.html.haml @@ -38,8 +38,10 @@ .table-wrapper %table.table %tbody + - total = @usage_by_domain.sum(&:statuses_count).to_f + - @usage_by_domain.each do |(domain, count)| %tr %th= domain || site_hostname - %td= number_to_percentage((count / @tag.history[0][:uses].to_f) * 100) + %td= number_to_percentage((count / total) * 100, precision: 1) %td= number_with_delimiter count -- cgit