mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°7302 Fix unit name in \SetupUtils::HumanReadableSize (#626)
This commit is contained in:
@@ -897,9 +897,18 @@ class SetupUtils
|
|||||||
return $f;
|
return $f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param float $fBytes size in raw bytes, for example 162594750464.0
|
||||||
|
* @return string formatted string, for example "161.62 GB"
|
||||||
|
*
|
||||||
|
* @link https://en.wiktionary.org/wiki/byte byte and not Byte
|
||||||
|
* @link https://en.wikipedia.org/wiki/Kilobyte kB and not KB (IEC 80000-13)
|
||||||
|
* @link https://en.wiktionary.org/wiki/petabyte petabyte PB
|
||||||
|
* @link https://en.wiktionary.org/wiki/exabyte exabyte EB
|
||||||
|
*/
|
||||||
public static function HumanReadableSize($fBytes)
|
public static function HumanReadableSize($fBytes)
|
||||||
{
|
{
|
||||||
$aSizes = array('bytes', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb', 'Hb');
|
$aSizes = array('bytes', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB');
|
||||||
$index = 0;
|
$index = 0;
|
||||||
while (($fBytes > 1000) && ($index < count($aSizes)))
|
while (($fBytes > 1000) && ($index < count($aSizes)))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user