helper.prettybytes.options.maximumfractiondigits
Home > @deep/helper > PrettyBytes > Options > maximumFractionDigits
PrettyBytes.Options.maximumFractionDigits property
The maximum number of fraction digits to display.
If neither minimumFractionDigits
or maximumFractionDigits
are set, the default behavior is to round to 3 significant digits.
readonly maximumFractionDigits?: number;
Example
import { prettyBytes } from '@deep/helper';
// Show the number with at most 1 fractional digit
P(1920, {maximumFractionDigits: 1});
//=> '1.9 kB'
P(1920);
//=> '1.92 kB'