@outbook/format-file-size
v1.0.2
Published
Format string function, with array or named placeholders
Downloads
59
Readme
format-string
Import and use it:
import { formatFileSize } from '@outbook/format-file-size';
formatFileSize({ size: 500 }); // "500 B"
formatFileSize({ size: 2048 }); // "2 KB"
formatFileSize({ size: 1048576 }); // "1 MB"
formatFileSize({ size: 1073741824 }); // "1 GB"
