mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 10:24:31 +02:00
Use 10 based prefixes for byte sizes instead of 2-based
This way we are consistent with the way symfony interprets the prefixes
This commit is contained in:
parent
e0635f7ead
commit
5a19024bec
2 changed files with 4 additions and 3 deletions
|
@ -160,7 +160,7 @@ class AttachmentManager
|
|||
|
||||
$sz = 'BKMGTP';
|
||||
$factor = (int) floor((strlen((string) $bytes) - 1) / 3);
|
||||
|
||||
return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor).@$sz[$factor];
|
||||
//Use real (10 based) SI prefixes
|
||||
return sprintf("%.{$decimals}f", $bytes / 1000 ** $factor).@$sz[$factor];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue