Make % online round to two decimal places (#1427)

This commit is contained in:
Kyle Knight
2017-04-07 07:50:11 -07:00
committed by GitHub
parent 54bd9a8f66
commit 3544535e1d
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -1,3 +1,5 @@
* Fix rounding error when showing % of online hosts
## Kolide 1.0.3 (April 3, 2017)
* Log rotation is no longer the default setting for Osquery status and results logs. To enable log rotation use the `--osquery_enable_log_rotation` flag.
@@ -23,7 +23,8 @@ class TargetDetails extends Component {
onlineHosts = (labelBaseClass, count, online) => {
const offline = count - online;
const percentOnline = ((count - offline) / count) * 100;
const percentCount = ((count - offline) / count) * 100;
const percentOnline = parseFloat(percentCount.toFixed(2));
if (online > 0) {
return (