UNPKG

envoc-form

Version:

Envoc form components

11 lines (10 loc) 357 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.humanFileSize = void 0; function humanFileSize(size) { var i = Math.floor(Math.log(size) / Math.log(1024)); return ((size / Math.pow(1024, i)).toFixed(2) + ' ' + ['B', 'KB', 'MB', 'GB', 'TB'][i]); } exports.humanFileSize = humanFileSize;