diff options
author | doktornotor <notordoktor@gmail.com> | 2017-02-26 20:33:46 +0100 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2017-03-21 15:12:10 +0545 |
commit | fdacd72b8889f602c786b13720349bf4ea0e16e2 (patch) | |
tree | 052cf89e8bdcd52fab6b8d2a2d1d46f8bbcc1f6c /src/usr/local/www/widgets | |
parent | a317691294a7b605e8b40fe0746481ebfb000b15 (diff) | |
download | pfsense-fdacd72b8889f602c786b13720349bf4ea0e16e2.zip pfsense-fdacd72b8889f602c786b13720349bf4ea0e16e2.tar.gz |
Reduce numeric precision in gateways widget to single decimal place (Feature #6841)
Diffstat (limited to 'src/usr/local/www/widgets')
-rw-r--r-- | src/usr/local/www/widgets/widgets/gateways.widget.php | 4 |
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"; |