From 26aa6d925615df52a2dc931dee60bfe53f4a1c74 Mon Sep 17 00:00:00 2001 From: Manuel Calavera Date: Wed, 2 Oct 2019 21:37:14 -0700 Subject: [PATCH] fix: uptime overflow --- src/v2/utils/getUptime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2/utils/getUptime.js b/src/v2/utils/getUptime.js index 73a94ef5..7501f832 100644 --- a/src/v2/utils/getUptime.js +++ b/src/v2/utils/getUptime.js @@ -1,7 +1,7 @@ import {compose, getOr, multiply} from 'lodash/fp'; export default compose( - time => parseFloat(time.toFixed(time ? 4 : 2)), + time => (time > 100 ? 100 : parseFloat(time.toFixed(time ? 4 : 2))), multiply(100), getOr(0, 'uptime.uptime.[0].percentage'), );