Skip to content

Commit

Permalink
#208: Display file size units
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrichblock committed Jan 2, 2014
1 parent be64593 commit e1d3ea5
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions web/third_party/monstaftp/class_monstaftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -1042,21 +1042,25 @@ private function getParentDir() {

private function formatFileSize($size) {

global $lang_size_b;
global $lang_size_kb;
global $lang_size_mb;
global $lang_size_gb;

if ($size == "d" || $size == "l") {

$size="";

} else {

if ($size < 1024) {
$size = round($size,2);
//$size = round($size,2).$lang_size_b;
$size = round($size,2).$lang_size_b;
} elseif ($size < (1024*1024)) {
$size = round(($size/1024),0).$this->lang_size_kb;
$size = round(($size/1024),0).' '.$lang_size_kb;
} elseif ($size < (1024*1024*1024)) {
$size = round((($size/1024)/1024),0).$this->lang_size_mb;
$size = round((($size/1024)/1024),0).' '.$lang_size_mb;
} elseif ($size < (1024*1024*1024*1024)) {
$size = round(((($size/1024)/1024)/1024),0).$this->lang_size_gb;
$size = round(((($size/1024)/1024)/1024),0).' '.$lang_size_gb;
}
}

Expand Down Expand Up @@ -2907,6 +2911,7 @@ private function uploadFile() {
// Delete tmp file
unlink($fp1);
}
return '';
}

###############################################
Expand Down Expand Up @@ -2982,6 +2987,7 @@ private function dragDropFiles() {
$this->deleteFtpHistory($dragFile);
}
}
return '';
}

###############################################
Expand Down

0 comments on commit e1d3ea5

Please sign in to comment.