From 5893296a689a135c5b36c9a4a73319315c0bd3fd Mon Sep 17 00:00:00 2001 From: r888888888 Date: Tue, 11 Feb 2014 16:32:29 -0800 Subject: [PATCH] show precision in tag list for posts btw 1k and 10k count --- app/presenters/tag_set_presenter.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/presenters/tag_set_presenter.rb b/app/presenters/tag_set_presenter.rb index 7e267dead..5ffdc4f89 100644 --- a/app/presenters/tag_set_presenter.rb +++ b/app/presenters/tag_set_presenter.rb @@ -115,8 +115,10 @@ private html << %{#{h(humanized_tag)} } unless options[:name_only] - if counts[tag].to_i >= 1_000 + if counts[tag].to_i >= 10_000 post_count = "#{counts[tag].to_i / 1_000}k" + elsif counts[tag].to_i >= 1_000 + post_count = "%.1fk" % (counts[tag].to_f / 1_000) else post_count = counts[tag].to_s end