2016-06-13 14:55:27 +02:00
|
|
|
// Re-export related utilities from js-utility-belt for easier access
|
2016-06-23 19:48:42 +02:00
|
|
|
export {
|
|
|
|
createTextFile,
|
|
|
|
computeFileHash,
|
|
|
|
extractFileExtensionFromString,
|
|
|
|
extractFileExtensionFromUrl
|
|
|
|
} from 'js-utility-belt/es6/file';
|
2016-07-08 16:31:26 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Transforms kb size to mb size, using an arbitrary rounding function at the end.
|
|
|
|
*
|
|
|
|
* @param {number} size Size in kb
|
|
|
|
* @param {function} roundFn Function to round out the precise size in mb, defaulting to Math.ceil.
|
|
|
|
* @return {number} Size in mb
|
|
|
|
*/
|
|
|
|
export function kbToMb(size, roundFn = Math.ceil) {
|
|
|
|
return roundFn(size / 1024);
|
|
|
|
}
|