Module: js-whatever/js/memory-format

js-whatever/js/memory-format

require("js-whatever/js/memory-format")(bytes, multiple) → {string}

Formats a number of bytes to one decimal place in the largest available unit

Parameters:
Name Type Argument Description
bytes number

The number of bytes to format

multiple number <optional>

The number of bytes will be multiplied by this before being formatted. Useful if
the value you need to format is not in bytes

Source:
Returns:

A formatted string

Type
string
Example
memoryFormat(10); // returns '10 B'
memoryFormat(1024); // returns '1.0 KB'
memoryFormat(2, 1024); // returns '2.0 KB'
Source:
Copyright 2013-2018 Micro Focus International plc. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
Documentation generated by JSDoc 3.4.3 on Thu Jun 21st 18:04 2018 using the DocStrap template.