Added library size to homepage (#264)

This commit is contained in:
Kieran
2024-05-27 10:43:50 -07:00
committed by GitHub
parent 3a5c06fe64
commit b2e16d50cd
5 changed files with 75 additions and 5 deletions
@@ -1,5 +1,13 @@
defmodule PinchflatWeb.Pages.PageHTML do
use PinchflatWeb, :html
alias Pinchflat.Utils.NumberUtils
embed_templates "page_html/*"
def readable_media_filesize(media_filesize) do
{num, suffix} = NumberUtils.human_byte_size(media_filesize, precision: 1)
"#{Float.round(num)} #{suffix}"
end
end