當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CUtils::format_Number方法代碼示例

本文整理匯總了PHP中CUtils::format_Number方法的典型用法代碼示例。如果您正苦於以下問題:PHP CUtils::format_Number方法的具體用法?PHP CUtils::format_Number怎麽用?PHP CUtils::format_Number使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CUtils的用法示例。


在下文中一共展示了CUtils::format_Number方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: catch

        } else {
            $job['compression'] = 'N/A';
        }
        // Job speed
        $start = $job['starttime'];
        $end = $job['endtime'];
        $seconds = DateTimeUtil::get_ElaspedSeconds($end, $start);
        if ($seconds !== false && $seconds > 0) {
            $speed = $job['jobbytes'] / $seconds;
            $job['speed'] = CUtils::Get_Human_Size($speed, 2) . '/s';
        } else {
            $job['speed'] = 'N/A';
        }
        // Job bytes more easy to read
        $job['jobbytes'] = CUtils::Get_Human_Size($job['jobbytes']);
        $job['jobfiles'] = CUtils::format_Number($job['jobfiles']);
        $jobs[] = $job;
    }
    // end while
} catch (Exception $e) {
    CErrorHandler::displayError($e);
}
$view->assign('jobs', $jobs);
$view->assign('backupjob_name', $backupjob_name);
$view->assign('backupjob_period', $backupjob_period);
$view->assign('backupjob_bytes', $backupjob_bytes);
$view->assign('backupjob_files', $backupjob_files);
// Set page name
$current_page = 'Backup job report';
$view->assign('page_name', $current_page);
// Process and display the template
開發者ID:ektich,項目名稱:bacula-web,代碼行數:31,代碼來源:backupjob-report.php

示例2: strftime

 $view->assign('literal_period', strftime("%a %e %b %Y", $custom_period[0]) . ' to ' . strftime("%a %e %b %Y", $custom_period[1]));
 // Running, completed, failed, waiting and canceled jobs status over last 24 hours
 $view->assign('running_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'running'));
 $view->assign('completed_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'completed'));
 $view->assign('failed_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'failed'));
 $view->assign('waiting_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'waiting'));
 $view->assign('canceled_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, 'canceled'));
 // Stored files number
 $view->assign('stored_files', CUtils::format_Number(Jobs_Model::getStoredFiles($dbSql->db_link, $no_period)));
 // Overall stored bytes
 $view->assign('stored_bytes', CUtils::Get_Human_Size(Jobs_Model::getStoredBytes($dbSql->db_link, $no_period)));
 // Database size
 $view->assign('database_size', Database_Model::get_Size($dbSql->db_link, $dbSql->catalog_current_id));
 // Total bytes and files stored over the last 24 hours
 $view->assign('bytes_last', CUtils::Get_Human_Size(Jobs_Model::getStoredBytes($dbSql->db_link, $custom_period)));
 $view->assign('files_last', CUtils::format_Number(Jobs_Model::getStoredFiles($dbSql->db_link, $custom_period)));
 // Number of clients
 $view->assign('clients', Clients_Model::count($dbSql->db_link));
 // Defined Jobs and Filesets
 $view->assign('defined_filesets', FileSets_Model::count($dbSql->db_link));
 $view->assign('defined_jobs', Jobs_Model::count_Job_Names($dbSql->db_link));
 // Incremental, Differential and Full jobs over the last 24 hours
 $view->assign('incr_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, null, J_INCR));
 $view->assign('diff_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, null, J_DIFF));
 $view->assign('full_jobs', Jobs_Model::count_Jobs($dbSql->db_link, $custom_period, null, J_FULL));
 // Volumes disk usage
 $volumes_size = Volumes_Model::getDiskUsage($dbSql->db_link);
 $view->assign('volumes_size', CUtils::Get_Human_Size($volumes_size));
 // Pools count
 $view->assign('pools_nb', Pools_Model::count($dbSql->db_link));
 // Backup Job list
開發者ID:ExaMuff,項目名稱:bacula-web,代碼行數:31,代碼來源:index.php


注:本文中的CUtils::format_Number方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。