-
-
Notifications
You must be signed in to change notification settings - Fork 98
Closed
Description
While using the library to format filesizes, it tends to show numbers in a weird way with fixed precision (most likely) because it is not computing the proper exponent.
Example:
Without precison
> filesize.filesize(1058223158, {base: 2, standard: 'iec'})
'1009.2 MiB'
> filesize.filesize(529825922, {base: 2, standard: 'iec'})
'505.28 MiB'
With precison
> filesize.filesize(1058223158, {base: 2, standard: 'iec', precision: 3})
'1.01e+3 MiB'
> filesize.filesize(529825922, {base: 2, standard: 'iec', precision: 3})
'505 MiB'
While not using precision seems to give a more readable output, I would like to use a defined precision and have '1.01e+3 MiB' shown as '0.990 GiB' instead.
Metadata
Metadata
Assignees
Labels
No labels