Skip to content

Commit

Permalink
For daily remaining < 1000MB, show in MB instead of GB
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdey committed Dec 5, 2013
1 parent 02ddc85 commit 2436b51
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internode.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,11 @@ function display_history() {
imagestring($im, 2, IMAGE_BORDER_LEFT+IMAGE_BORDER+imagefontwidth(2), (imagefontheight(2) * 3), $string, $darkgreen);

if($this->remaining > 0) {
$string = sprintf("Daily Remaining: %.1f Mb Total Remaining: %.1f Gb", ($this->remaining / $this->days_remaining), ($this->remaining/1000) );
if ($this->remaining < 1000) {
$string = sprintf("Daily Remaining: %6.1f Mb Total Remaining: %5.1f Mb", ($this->remaining / $this->days_remaining), $this->remaining );
} else {
$string = sprintf("Daily Remaining: %6.1f Mb Total Remaining: %5.1f Gb", ($this->remaining / $this->days_remaining), ($this->remaining/1000) );
}
imagestring($im, 2, IMAGE_BORDER_LEFT+IMAGE_BORDER+imagefontwidth(2), (imagefontheight(2) * 4), $string, $orange);
} else {
$over = abs($this->remaining);
Expand Down

0 comments on commit 2436b51

Please sign in to comment.