Skip to content

Commit 0135740

Browse files
committed
Changing conversion: 1 mb = 1024 kb
I found that quota is using MB as 1024 KB, but in vestacp, if you set quota for a package 1024 MB, it's showing you 1,02 GB inside the panel. If you edit the package and add 1000 MB, it's showing correctly in the panel, 1GB, but quota is exceeded at 976 MB. humanize_usage use 1000 MB as 1GB instead of 1024 MB, so I fixed it.
1 parent 3b7eee4 commit 0135740

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

web/inc/main.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ function humanize_time($usage) {
151151
}
152152

153153
function humanize_usage($usage) {
154-
if ( $usage > 1000 ) {
155-
$usage = $usage / 1000;
156-
if ( $usage > 1000 ) {
157-
$usage = $usage / 1000 ;
158-
if ( $usage > 1000 ) {
159-
$usage = $usage / 1000 ;
154+
if ( $usage > 1024 ) {
155+
$usage = $usage / 1024;
156+
if ( $usage > 1024 ) {
157+
$usage = $usage / 1024 ;
158+
if ( $usage > 1024 ) {
159+
$usage = $usage / 1024 ;
160160
$usage = number_format($usage, 2);
161161
$usage = $usage."".__('pb');
162162
} else {

0 commit comments

Comments
 (0)