--- loncom/interface/londocs.pm 2016/06/06 17:40:48 1.604 +++ loncom/interface/londocs.pm 2016/06/10 22:31:27 1.605 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.604 2016/06/06 17:40:48 raeburn Exp $ +# $Id: londocs.pm,v 1.605 2016/06/10 22:31:27 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5224,8 +5224,22 @@ sub handler { "userfiles/$subdir",1); # expressed in kB } my $free_space = 1024 * ((1024 * $disk_quota) - $current_disk_usage); + my $usage = $current_disk_usage/1024; # in MB + my $quota = $disk_quota; + my $percent; + if ($disk_quota == 0) { + $percent = 100.0; + } else { + $percent = 100*($current_disk_usage/$disk_quota); + } + $usage = sprintf("%.2f",$usage); + $quota = sprintf("%.2f",$quota); + $percent = sprintf("%.0f",$percent); + my $quotainfo = '

'.&mt('Currently using [_1] of the [_2] available.', + $percent.'%',$quota.' MB').'

'; my $fileupload=(<