Merge string concatenation into sprintf()

This commit is contained in:
Chris Kankiewicz
2021-08-24 19:56:14 -07:00
parent a080acefbc
commit 0aacdef703

View File

@@ -22,6 +22,6 @@ class SizeForHumans extends ViewFunction
$sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
$factor = (int) floor((strlen((string) $fileSize) - 1) / 3);
return sprintf('%.2f', $fileSize / pow(1024, $factor)) . $sizes[$factor];
return sprintf('%.2f%s', $fileSize / pow(1024, $factor), $sizes[$factor]);
}
}