@draconides/format
Version:
Formatter function
21 lines • 735 B
TypeScript
type FormatBytesOptions = {
decimals?: number;
formatter?: (value: number) => string;
conversion?: 'binary' | 'decimal';
style?: 'byte' | 'octet';
unitFormat?: 'full' | 'minimal';
};
/**
* Format a byte value into a readable string
* @param bytes Byte to format
* @param options Option object
* @param options.decimals Number of decimals
* @param options.formatter Function to formate the number
* @param options.conversion Type of conversion
* @param options.style Type of the unit
* @param options.unitFormat Unit format
* @returns formated bytes
*/
declare const formatBytes: (bytes: number, options?: FormatBytesOptions) => string;
export default formatBytes;
//# sourceMappingURL=formatBytes.d.ts.map