diff --git a/lib/towerops_web/live/dashboard_live.ex b/lib/towerops_web/live/dashboard_live.ex index a7b73ac2..d18667b3 100644 --- a/lib/towerops_web/live/dashboard_live.ex +++ b/lib/towerops_web/live/dashboard_live.ex @@ -287,6 +287,12 @@ defmodule ToweropsWeb.DashboardLive do defp format_number(number), do: to_string(number) + defp format_subscriber_count(count) when is_float(count), do: format_subscriber_count(round(count)) + + defp format_subscriber_count(count) when is_integer(count) and count > 0 do + ngettext("%{count} sub", "%{count} subs", count, count: count) + end + defp format_duration(nil), do: "Unknown" defp format_duration(seconds) when is_integer(seconds) do diff --git a/lib/towerops_web/live/dashboard_live.html.heex b/lib/towerops_web/live/dashboard_live.html.heex index 3593142a..fac1596a 100644 --- a/lib/towerops_web/live/dashboard_live.html.heex +++ b/lib/towerops_web/live/dashboard_live.html.heex @@ -489,7 +489,7 @@