mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-19 07:56:41 +00:00
implemented a functional template system, and a simple WORKING template, and other smaller things and fixes...
git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@10 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
@@ -89,7 +89,6 @@ class dirList {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ==============================================
|
||||
// ----- [ Internal Functions ] -----------------
|
||||
// ==============================================
|
||||
@@ -150,10 +149,9 @@ class dirList {
|
||||
$types = array('bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
for($n = 0; $bytes >= 1024; $n++) $bytes = $bytes / 1024;
|
||||
$bytes = number_format($bytes, 2);
|
||||
if ( !empty($bytes[1]) ) {
|
||||
$bytes = explode('.', $bytes);
|
||||
$bytes[1] = rtrim($bytes[1], '0');
|
||||
$bytes = ( $bytes[1] != '' ) ? $bytes[0].'.'.$bytes[1] : $bytes[0] ;
|
||||
if ( preg_match("/([0-9]+)\.([0-9]+)/", $bytes, $bytes) ) {
|
||||
$bytes[2] = rtrim($bytes[2], '0');
|
||||
$bytes = ( !empty($bytes[2]) ) ? $bytes[1].'.'.$bytes[2] : $bytes[1] ;
|
||||
}
|
||||
return $bytes.' '.$types[$n];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user