If the PMA_formatNumber() parameters would result in 0.0, it displays <0.1 instead

This commit is contained in:
Tyron Madlener 2011-05-31 10:33:37 +02:00 committed by Michal Čihař
parent 5fa80010f5
commit a311518494

View File

@ -891,9 +891,9 @@ function PMA_reloadNavigation($jsonly=false)
unset($_SESSION['tmp_user_values']['table_limit_offset']);
echo "\n";
$reload_url = './navigation.php?' . PMA_generate_common_url($GLOBALS['db'], '', '&');
if (!$jsonly)
echo '<script type="text/javascript">' . PHP_EOL;
?>
if (!$jsonly)
echo '<script type="text/javascript">' . PHP_EOL;
?>
//<![CDATA[
if (typeof(window.parent) != 'undefined'
&& typeof(window.parent.frame_navigation) != 'undefined'
@ -1432,7 +1432,10 @@ function PMA_formatNumber($value, $length = 3, $comma = 0, $only_down = false)
{
//number_format is not multibyte safe, str_replace is safe
if ($length === 0) {
return PMA_localizeNumber(number_format($value, $comma));
$value = number_format($value, $comma);
if(floatval($value) == 0) $value = ' <'.(1/PMA_pow(10,$comma));
return PMA_localizeNumber($value);
}
// this units needs no translation, ISO
@ -1494,6 +1497,8 @@ function PMA_formatNumber($value, $length = 3, $comma = 0, $only_down = false)
//number_format is not multibyte safe, str_replace is safe
$value = PMA_localizeNumber(number_format($value, $comma));
if(floatval($value) == 0) return ' <'.(1/PMA_pow(10,$comma)).' '.$unit;
return $sign . $value . ' ' . $unit;
} // end of the 'PMA_formatNumber' function
@ -1644,10 +1649,10 @@ function PMA_generate_html_tab($tab, $url_params = array())
$tab['attr'] .= ' title="' . htmlspecialchars($tab['warning']) . '"';
}
// If there are any tab specific URL parameters, merge those with the general URL parameters
if(! empty($tab['url_params']) && is_array($tab['url_params'])) {
$url_params = array_merge($url_params, $tab['url_params']);
}
// If there are any tab specific URL parameters, merge those with the general URL parameters
if(! empty($tab['url_params']) && is_array($tab['url_params'])) {
$url_params = array_merge($url_params, $tab['url_params']);
}
// build the link
if (!empty($tab['link'])) {
@ -2937,8 +2942,8 @@ function PMA_browseUploadFile($max_upload_size) {
* @param $uploaddir
*/
function PMA_selectUploadFile($import_list, $uploaddir) {
echo '<label for="radio_local_import_file">' . sprintf(__("Select from the web server upload directory <b>%s</b>:"), htmlspecialchars(PMA_userDir($uploaddir))) . '</label>';
$extensions = '';
echo '<label for="radio_local_import_file">' . sprintf(__("Select from the web server upload directory <b>%s</b>:"), htmlspecialchars(PMA_userDir($uploaddir))) . '</label>';
$extensions = '';
foreach ($import_list as $key => $val) {
if (!empty($extensions)) {
$extensions .= '|';