708509590 のリファクタリングの意図をつかめてませんが
diff --git a/plugin/mastodon_account_viewer/mastodon_account_viewer.rb b/plugin/mastodon_account_viewer/mastodon_account_viewer.rb
index 5d0b21e3..dab57b58 100644
--- a/plugin/mastodon_account_viewer/mastodon_account_viewer.rb
+++ b/plugin/mastodon_account_viewer/mastodon_account_viewer.rb
@@ -17,7 +17,7 @@ Plugin.create(:mastodon_account_viewer) do
}
param_toot_count = {
count: user.statuses_count,
- toots_per_day: since_day == 0 ? user.statuses_count : '%{avg}.2f' % { avg: Rational(user.statuses_count, since_day).to_f }
+ toots_per_day: since_day == 0 ? user.statuses_count : '%{avg}' % { avg: Rational(user.statuses_count, since_day).to_f.round(2) }
}
[
[_('名前'), user.display_name],
もしくはリファクタリング前と同様に
diff --git a/plugin/mastodon_account_viewer/mastodon_account_viewer.rb b/plugin/mastodon_account_viewer/mastodon_account_viewer.rb
index 5d0b21e3..cfe8d735 100644
--- a/plugin/mastodon_account_viewer/mastodon_account_viewer.rb
+++ b/plugin/mastodon_account_viewer/mastodon_account_viewer.rb
@@ -17,7 +17,7 @@ Plugin.create(:mastodon_account_viewer) do
}
param_toot_count = {
count: user.statuses_count,
- toots_per_day: since_day == 0 ? user.statuses_count : '%{avg}.2f' % { avg: Rational(user.statuses_count, since_day).to_f }
+ toots_per_day: since_day == 0 ? user.statuses_count : "%.2f" % (Rational(user.statuses_count, since_day).to_f)
}
[
[_('名前'), user.display_name],
でいいんですかね。
avg:
の意図を把握できてませんが。