fix: byte units (#4419)
This commit is contained in:
parent
e0e0689846
commit
597821b3bb
4 changed files with 19 additions and 19 deletions
|
@ -21,22 +21,22 @@ describe('@/lib/formatters.ts', function () {
|
|||
[100.998, '101 Bytes'],
|
||||
[512, '512 Bytes'],
|
||||
[1000, '1000 Bytes'],
|
||||
[1024, '1 KB'],
|
||||
[5068, '4.95 KB'],
|
||||
[10_000, '9.77 KB'],
|
||||
[10_240, '10 KB'],
|
||||
[11_864, '11.59 KB'],
|
||||
[1_000_000, '976.56 KB'],
|
||||
[1_024_000, '1000 KB'],
|
||||
[1_025_000, '1000.98 KB'],
|
||||
[1_048_576, '1 MB'],
|
||||
[1_356_000, '1.29 MB'],
|
||||
[1_000_000_000, '953.67 MB'],
|
||||
[1_070_000_100, '1020.43 MB'],
|
||||
[1_073_741_824, '1 GB'],
|
||||
[1_678_342_000, '1.56 GB'],
|
||||
[1_000_000_000_000, '931.32 GB'],
|
||||
[1_099_511_627_776, '1 TB'],
|
||||
[1024, '1 KiB'],
|
||||
[5068, '4.95 KiB'],
|
||||
[10_000, '9.77 KiB'],
|
||||
[10_240, '10 KiB'],
|
||||
[11_864, '11.59 KiB'],
|
||||
[1_000_000, '976.56 KiB'],
|
||||
[1_024_000, '1000 KiB'],
|
||||
[1_025_000, '1000.98 KiB'],
|
||||
[1_048_576, '1 MiB'],
|
||||
[1_356_000, '1.29 MiB'],
|
||||
[1_000_000_000, '953.67 MiB'],
|
||||
[1_070_000_100, '1020.43 MiB'],
|
||||
[1_073_741_824, '1 GiB'],
|
||||
[1_678_342_000, '1.56 GiB'],
|
||||
[1_000_000_000_000, '931.32 GiB'],
|
||||
[1_099_511_627_776, '1 TiB'],
|
||||
])('should format %d bytes as "%s"', function (input, output) {
|
||||
expect(bytesToString(input)).toBe(output);
|
||||
});
|
||||
|
|
Reference in a new issue