(bytes: bigint)
| 53 | } |
| 54 | |
| 55 | export const formatBytesShort = (bytes: bigint) => { |
| 56 | const { value, unit } = humanizeBytes(bytes); |
| 57 | const numberFormatter = Intl.NumberFormat("default", { |
| 58 | maximumFractionDigits: value % 1 === 0 ? 0 : 2, |
| 59 | }); |
| 60 | return `${numberFormatter.format(value)} ${unit}`; |
| 61 | }; |
| 62 | |
| 63 | export function convertBytes(bytes: number, unit: ByteUnit) { |
| 64 | switch (unit) { |
no test coverage detected