Is your feature request related to a problem? Please describe.
Currently, the FileSizePipe uses a hard-coded binary standard (JEDEC) for formatting file sizes. Changing the standard requires modifying the source code.
For comparison between different standards, look at ss below:
SI
1 MB = 1000 kB
JEDEC
1 MB = 1024 KB
IEC
1 MiB = 1024 KiB
Describe the solution you'd like
Make file size format configurable.
Here's where it can be found:
|
export class FileSizePipe implements PipeTransform { |
|
transform(bytes: number = 0, precision: number = 2): string { |
|
return filesize(bytes, { standard: 'jedec', round: precision }); |
|
} |
Describe alternatives or workarounds you've considered
—
Additional information
Is your feature request related to a problem? Please describe.
Currently, the FileSizePipe uses a hard-coded binary standard (JEDEC) for formatting file sizes. Changing the standard requires modifying the source code.
For comparison between different standards, look at ss below:
SI
1 MB = 1000 kB
JEDEC
1 MB = 1024 KB
IEC
1 MiB = 1024 KiB
Describe the solution you'd like
Make file size format configurable.
Here's where it can be found:
dspace-angular/src/app/shared/utils/file-size-pipe.ts
Lines 20 to 23 in aadea29
Describe alternatives or workarounds you've considered
—
Additional information