summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2017-02-26 20:33:46 +0100
committerPhil Davis <phil.davis@inf.org>2017-03-21 23:14:15 +0545
commit50418f9711c39d7229bd54c576d8491093aaa7b0 (patch)
tree666bb101079df966dad4d30d74ab769761cb136d
parentf3ee7e05795bc99c8cb922944e4f56e8c3199442 (diff)
downloadpfsense-50418f9711c39d7229bd54c576d8491093aaa7b0.zip
pfsense-50418f9711c39d7229bd54c576d8491093aaa7b0.tar.gz
Reduce numeric precision in gateways widget to single decimal place (Feature #6841)
-rw-r--r--src/usr/local/www/widgets/widgets/gateways.widget.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/usr/local/www/widgets/widgets/gateways.widget.php b/src/usr/local/www/widgets/widgets/gateways.widget.php
index 822030f..311eb71 100644
--- a/src/usr/local/www/widgets/widgets/gateways.widget.php
+++ b/src/usr/local/www/widgets/widgets/gateways.widget.php
@@ -342,8 +342,8 @@ function compose_table_body_contents() {
$bgcolor = "info"; // lightblue
}
- $rtnstr .= "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['delay']) : gettext("Pending")) . "</td>\n";
- $rtnstr .= "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['stddev']) : gettext("Pending")) . "</td>\n";
+ $rtnstr .= "<td>" . ($gateways_status[$gname] ? ($gateways_status[$gname]['delay'] ? htmlspecialchars(number_format((float)rtrim($gateways_status[$gname]['delay'], "ms"), 1)) . "ms" : '') : gettext("Pending")) . "</td>\n";
+ $rtnstr .= "<td>" . ($gateways_status[$gname] ? ($gateways_status[$gname]['stddev'] ? htmlspecialchars(number_format((float)rtrim($gateways_status[$gname]['stddev'], "ms"), 1)) . "ms" : '') : gettext("Pending")) . "</td>\n";
$rtnstr .= "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['loss']) : gettext("Pending")) . "</td>\n";
$rtnstr .= '<td class="bg-' . $bgcolor . '">' . $online . "</td>\n";
$rtnstr .= "</tr>\n";
OpenPOWER on IntegriCloud