mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-24 02:18:15 +01:00
Rename files
This commit is contained in:
10
ts/util/formatFileSize.std.ts
Normal file
10
ts/util/formatFileSize.std.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import filesize from 'filesize';
|
||||
|
||||
// Intentional, `filesize` uses `jedec` standard by default
|
||||
const MB = 1000 * 1000;
|
||||
|
||||
export function formatFileSize(size: number): string {
|
||||
return filesize(size, { round: size < MB ? 0 : 1 });
|
||||
}
|
||||
Reference in New Issue
Block a user