Fix humand readable byte to number javascript method call
This commit is contained in:
@@ -458,13 +458,13 @@ function formatBytesLong(bytes)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a string with B/K/M/etc into a byte number
|
* Convert a string with B/K/M/etc into a byte number
|
||||||
* @param {String} bytes Any string with B/K/M/etc
|
* @param {String|Number} bytes Any string with B/K/M/etc
|
||||||
* @return {Number} A byte number, or original string as is
|
* @return {String|Number} A byte number, or original string as is
|
||||||
*/
|
*/
|
||||||
function stringByteFormat(bytes)
|
function stringByteFormat(bytes)
|
||||||
{
|
{
|
||||||
// early abort if this is a number already
|
// if anything not string return
|
||||||
if (!isNaN(bytes)) {
|
if (!(typeof bytes === 'string' || bytes instanceof String)) {
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
// for pow exponent list
|
// for pow exponent list
|
||||||
|
|||||||
Reference in New Issue
Block a user