View Single Post
  #7  
Old 27th May 2013, 17:07
remy74 remy74 is offline
Junior Member
 
Join Date: May 2013
Posts: 16
Thanks: 9
Thanked 6 Times in 4 Posts
Smile

Hi All,

Another question for everybody who knows.. Is there an inside function to convert a integer of byte to MB / GB / TB before display it ?
We have see :

Code:
    public function convertSize($value)
    {
        $unit = array('Bytes', 'KB', 'MB', 'GB', 'TB');
        return @round($value/pow(1024, ($i = floor(log($value, 1024)))), 2).' '.$unit[$i];
    }
under ApsBase, but nothing that could help us.
We would like to use it for display the value, not set it (in the DB we prefer have the byte value..)
Maybe with a filter in the tform ?
If someone have an idea..

Thanks for your precious help.
Reply With Quote