show size with overhead

This commit is contained in:
cupcakearmy 2022-07-18 23:48:55 +02:00
parent 2e6d3af995
commit 15db684a93
No known key found for this signature in database
GPG Key ID: 3235314B4D31232F
1 changed files with 7 additions and 2 deletions

View File

@ -1,12 +1,17 @@
<script lang="ts">
import { status } from '$lib/stores/status'
import prettyBytes from 'pretty-bytes'
import { _ } from 'svelte-intl-precompile'
import { status } from '$lib/stores/status'
// Due to encoding overhead (~35%) with base64
// https://en.wikipedia.org/wiki/Base64
const overhead = 1 / 1.35
</script>
<span>
{#if $status !== null}
{prettyBytes($status.max_size, { binary: true })}
{prettyBytes($status.max_size * overhead, { binary: true })}
{:else}
{$_('common.loading')}
{/if}