Commit 519fbd7e authored by Till Brehm's avatar Till Brehm

Merge branch 'limit-rounding' into 'stable-3.1'

Limit rounding quota to 1 decimal

See merge request !846
parents a5796fc0 79f6d0c8
Pipeline #231 passed with stage
in 2 minutes and 39 seconds
......@@ -54,19 +54,19 @@ class quota_lib {
if($used_ratio >= 1) $sites[$i]['display_colour'] = '#cc0000';
if($sites[$i]['used'] > 1024) {
$sites[$i]['used'] = round($sites[$i]['used'] / 1024, 2).' MB';
$sites[$i]['used'] = round($sites[$i]['used'] / 1024, 1).' MB';
} else {
if ($sites[$i]['used'] != '') $sites[$i]['used'] .= ' KB';
}
if($sites[$i]['soft'] > 1024) {
$sites[$i]['soft'] = round($sites[$i]['soft'] / 1024, 2).' MB';
$sites[$i]['soft'] = round($sites[$i]['soft'] / 1024, 1).' MB';
} else {
$sites[$i]['soft'] .= ' KB';
}
if($sites[$i]['hard'] > 1024) {
$sites[$i]['hard'] = round($sites[$i]['hard'] / 1024, 2).' MB';
$sites[$i]['hard'] = round($sites[$i]['hard'] / 1024, 1).' MB';
} else {
$sites[$i]['hard'] .= ' KB';
}
......@@ -268,14 +268,14 @@ class quota_lib {
if($emails[$i]['quota'] == 0){
$emails[$i]['quota'] = $app->lng('unlimited');
} else {
$emails[$i]['quota'] = round($emails[$i]['quota'] / 1048576, 4).' MB';
$emails[$i]['quota'] = round($emails[$i]['quota'] / 1048576, 1).' MB';
}
if($emails[$i]['used'] < 1544000) {
$emails[$i]['used'] = round($emails[$i]['used'] / 1024, 4).' KB';
$emails[$i]['used'] = round($emails[$i]['used'] / 1024, 1).' KB';
} else {
$emails[$i]['used'] = round($emails[$i]['used'] / 1048576, 4).' MB';
$emails[$i]['used'] = round($emails[$i]['used'] / 1048576, 1).' MB';
}
}
}
......@@ -334,9 +334,9 @@ class quota_lib {
if($databases[$i]['used'] < 1544000) {
$databases[$i]['used'] = round($databases[$i]['used'] / 1024, 4).' KB';
$databases[$i]['used'] = round($databases[$i]['used'] / 1024, 1).' KB';
} else {
$databases[$i]['used'] = round($databases[$i]['used'] / 1048576, 4).' MB';
$databases[$i]['used'] = round($databases[$i]['used'] / 1048576, 1).' MB';
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment