file-size-str
v1.0.2
Published
Number format to file size string .
Downloads
4
Maintainers
Readme
file-size-str
Number format to file size string .
Install
npm i file-size-str --save
Example
const filesize = require("file-size-str");
console.log(filesize(100)); //100 B
console.log(filesize(100,1));//100.0 B
console.log(filesize(1000000000000,10));//931.3225746155 GB
Parameter
filesize(number,precision);
number : need format value
precision : the return precision with toFixed