Skip to content
Prev Previous commit
Round to a whole number and set a minimum
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Jun 10, 2022
commit 23ba2a0fc379f51d502d897481049241c23a466d
4 changes: 2 additions & 2 deletions lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ public function exportable(?array $migrators): DataResponse {

try {
$size = $this->migrationService->estimateExportSize($user, $migrators);
// Convert to MiB and round to one significant digit after the decimal point
$roundedSize = round($size / 1024, 1);
// Round and convert to MiB
$roundedSize = max(1, round($size / 1024));
} catch (UserMigrationException $e) {
throw new OCSException($e->getMessage());
}
Expand Down