utils.prettybytes.options.minimumfractiondigits
Home > @nipem/utils > PrettyBytes > Options > minimumFractionDigits
PrettyBytes.Options.minimumFractionDigits property
The minimum number of fraction digits to display
If neither minimumFractionDigits
or maximumFractionDigits
are set, the default behavior is to round to 3 significant digits.
readonly minimumFractionDigits?: number;
Example
import { prettyBytes } from '@nipem/utils';
// Show the number with at least 3 fractional digits
P(1900, {minimumFractionDigits: 3});
//=> '1.900 kB'
P(1900);
//=> '1.9 kB'