Update for humanReadableByteFormat, update edit.jq.js
edit.jq.js: remove deprecated function decodeHtmlEntities, use utils.js instead update for humanReadableByteFormat to return non numeric first and then proceed with the convert
This commit is contained in:
@@ -1602,6 +1602,7 @@ function createNavMenu(nav_menu, header_id = 'mainHeader') // eslint-disable-lin
|
||||
* HTML decode &something; entrie
|
||||
* @param {string} str
|
||||
* @returns string
|
||||
* @deprecated use utils.js
|
||||
*/
|
||||
function decodeHtmlEntities(str) // eslint-disable-line no-unused-vars
|
||||
{
|
||||
|
||||
@@ -43,7 +43,10 @@ class Byte
|
||||
public static function humanReadableByteFormat(string|int|float $bytes, int $flags = 0): string
|
||||
{
|
||||
// if not numeric, return as is
|
||||
if (is_numeric($bytes)) {
|
||||
if (!is_numeric($bytes)) {
|
||||
// if anything other return as string
|
||||
return (string)$bytes;
|
||||
}
|
||||
// flags bit wise check
|
||||
// remove space between number and suffix
|
||||
if ($flags & self::BYTE_FORMAT_NOSPACE) {
|
||||
@@ -104,10 +107,6 @@ class Byte
|
||||
} else {
|
||||
return round($bytes_calc, 2) . $pre;
|
||||
}
|
||||
} else {
|
||||
// if anything other return as string
|
||||
return (string)$bytes;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user