Fixed human-readable file size representation (#137)

(as it follows units of IEC 60027-2 A.2 )
This commit is contained in:
0x6d61726b
2024-03-03 15:48:56 +01:00
committed by GitHub
parent f763b9657f
commit 51bcd82ea7
5 changed files with 20 additions and 13 deletions

View File

@@ -17,7 +17,7 @@ import {
} from '@mui/material'
import { useCallback } from 'react'
import { RPCResult } from '../types'
import { ellipsis, formatSpeedMiB, mapProcessStatus, roundMiB } from '../utils'
import { ellipsis, formatSpeedMiB, mapProcessStatus, formatSize } from '../utils'
type Props = {
download: RPCResult
@@ -86,7 +86,7 @@ const DownloadCard: React.FC<Props> = ({ download, onStop, onCopy }) => {
{!isCompleted() ? formatSpeedMiB(download.progress.speed) : ''}
</Typography>
<Typography>
{roundMiB(download.info.filesize_approx ?? 0)}
{formatSize(download.info.filesize_approx ?? 0)}
</Typography>
<Resolution resolution={download.info.resolution} />
</Stack>