Consolidate fileSize formatting logic
This commit is contained in:
parent
568e31a7bf
commit
c4ba3c44ce
6 changed files with 16 additions and 11 deletions
7
ts/util/formatFileSize.ts
Normal file
7
ts/util/formatFileSize.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import filesize from 'filesize';
|
||||
|
||||
export function formatFileSize(size: number): string {
|
||||
return filesize(size, { round: 0 });
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue