M3 Integration fixes
This commit is contained in:
Regular → Executable
+8
-10
@@ -52,18 +52,16 @@ class DocumentationAttachment extends Model
|
||||
{
|
||||
$bytes = (int) $this->size;
|
||||
|
||||
$label = number_format($bytes / 1048576, 1) . ' MB';
|
||||
|
||||
if ($bytes <= 0) {
|
||||
return 'Unknown size';
|
||||
$label = 'Unknown size';
|
||||
} elseif ($bytes < 1024) {
|
||||
$label = $bytes . ' B';
|
||||
} elseif ($bytes < 1048576) {
|
||||
$label = number_format($bytes / 1024, 1) . ' KB';
|
||||
}
|
||||
|
||||
if ($bytes < 1024) {
|
||||
return $bytes . ' B';
|
||||
}
|
||||
|
||||
if ($bytes < 1048576) {
|
||||
return number_format($bytes / 1024, 1) . ' KB';
|
||||
}
|
||||
|
||||
return number_format($bytes / 1048576, 1) . ' MB';
|
||||
return $label;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user