Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #48 from fbergkemper/master
Browse files Browse the repository at this point in the history
written bytes fixed
  • Loading branch information
frabdev committed Sep 9, 2014
2 parents 89f7fae + 509e2b0 commit 275e180
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
32 changes: 16 additions & 16 deletions module/Application/src/Application/View/Helper/Bytes.php
Expand Up @@ -33,27 +33,27 @@
class Bytes extends AbstractHelper
{

protected $mb;
protected $bsize;

/**
* @method
* @return string
*/
public function __invoke($bytes)
{
/**
* @method
* @return string
*/
public function __invoke($bytes)
{

$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB');
$this->b = "0.00 B";
$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB');
$this->bsize = "0.00 B";

if($bytes > 0)
{
$result = log($bytes) / log(1024);
$this->b = round(pow(1024, $result - ($tmp = floor($result))), 2)." ".$units[$tmp];
}
if($bytes > 0)
{
$result = log($bytes) / log(1000);
$this->bsize = round(pow(1000, $result - ($tmp = floor($result))), 2)." ".$units[$tmp];
}

return $this->b;
return $this->bsize;

}
}

}

1 change: 1 addition & 0 deletions module/Job/src/Job/Model/JobTable.php
Expand Up @@ -244,6 +244,7 @@ public function getLast24HoursSuccessfulJobs($paginated=false, $order_by=null, $
$bsqlch->strdbcompat("Level"),
$bsqlch->strdbcompat("StartTime"),
$bsqlch->strdbcompat("EndTime"),
$bsqlch->strdbcompat("JobBytes"),
$bsqlch->strdbcompat("JobStatus"),
'duration' => $duration,
)
Expand Down

0 comments on commit 275e180

Please sign in to comment.