Skip to content

Commit 519fbd7

Browse files
author
Till Brehm
committed
Merge branch 'limit-rounding' into 'stable-3.1'
Limit rounding quota to 1 decimal See merge request ispconfig/ispconfig3!846
2 parents a5796fc + 79f6d0c commit 519fbd7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

interface/lib/classes/quota_lib.inc.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,19 @@ public function get_quota_data($clientid = null, $readable = true) {
5454
if($used_ratio >= 1) $sites[$i]['display_colour'] = '#cc0000';
5555

5656
if($sites[$i]['used'] > 1024) {
57-
$sites[$i]['used'] = round($sites[$i]['used'] / 1024, 2).' MB';
57+
$sites[$i]['used'] = round($sites[$i]['used'] / 1024, 1).' MB';
5858
} else {
5959
if ($sites[$i]['used'] != '') $sites[$i]['used'] .= ' KB';
6060
}
6161

6262
if($sites[$i]['soft'] > 1024) {
63-
$sites[$i]['soft'] = round($sites[$i]['soft'] / 1024, 2).' MB';
63+
$sites[$i]['soft'] = round($sites[$i]['soft'] / 1024, 1).' MB';
6464
} else {
6565
$sites[$i]['soft'] .= ' KB';
6666
}
6767

6868
if($sites[$i]['hard'] > 1024) {
69-
$sites[$i]['hard'] = round($sites[$i]['hard'] / 1024, 2).' MB';
69+
$sites[$i]['hard'] = round($sites[$i]['hard'] / 1024, 1).' MB';
7070
} else {
7171
$sites[$i]['hard'] .= ' KB';
7272
}
@@ -268,14 +268,14 @@ public function get_mailquota_data($clientid = null, $readable = true) {
268268
if($emails[$i]['quota'] == 0){
269269
$emails[$i]['quota'] = $app->lng('unlimited');
270270
} else {
271-
$emails[$i]['quota'] = round($emails[$i]['quota'] / 1048576, 4).' MB';
271+
$emails[$i]['quota'] = round($emails[$i]['quota'] / 1048576, 1).' MB';
272272
}
273273

274274

275275
if($emails[$i]['used'] < 1544000) {
276-
$emails[$i]['used'] = round($emails[$i]['used'] / 1024, 4).' KB';
276+
$emails[$i]['used'] = round($emails[$i]['used'] / 1024, 1).' KB';
277277
} else {
278-
$emails[$i]['used'] = round($emails[$i]['used'] / 1048576, 4).' MB';
278+
$emails[$i]['used'] = round($emails[$i]['used'] / 1048576, 1).' MB';
279279
}
280280
}
281281
}
@@ -334,9 +334,9 @@ public function get_databasequota_data($clientid = null, $readable = true) {
334334

335335

336336
if($databases[$i]['used'] < 1544000) {
337-
$databases[$i]['used'] = round($databases[$i]['used'] / 1024, 4).' KB';
337+
$databases[$i]['used'] = round($databases[$i]['used'] / 1024, 1).' KB';
338338
} else {
339-
$databases[$i]['used'] = round($databases[$i]['used'] / 1048576, 4).' MB';
339+
$databases[$i]['used'] = round($databases[$i]['used'] / 1048576, 1).' MB';
340340
}
341341
}
342342
}

0 commit comments

Comments
 (0)