mirror of
https://github.com/notf0und/SGS
synced 2026-07-18 02:31:08 +00:00
### Changes
Fixes #3: Error on DBI when files or folders contains special characters. ### Additional changes * Added unit and feature tests * Fix file size display * Run tests on CI/CD * Publish docker image on release
This commit is contained in:
parent
15b9c17b99
commit
0993bfa666
@@ -20,7 +20,8 @@ class FileSize
|
||||
$unitIndex = min($unitIndex, count(self::UNITS) - 1);
|
||||
|
||||
$size = $bytes / pow(self::THRESHOLD, $unitIndex);
|
||||
|
||||
return number_format($size, 2) . self::UNITS[$unitIndex];
|
||||
$decimals = $unitIndex === 0 ? 0 : 2;
|
||||
|
||||
return number_format($size, $decimals, '.', '') . self::UNITS[$unitIndex];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user