Modified round decimals to avoid round string values

This commit is contained in:
fermin831 2018-04-19 19:17:04 +02:00
parent 418d8b12b7
commit d6a695f793
1 changed files with 3 additions and 0 deletions

View File

@ -1554,6 +1554,9 @@ function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, er
}
function round_with_decimals (value, multiplier = 1) {
// Return non numeric types without modification
if (typeof(value) !== "number") return value;
if ((value * multiplier) == 0) return 0;
if ((value * multiplier) >= 1) {
return Math.round(value * multiplier) / multiplier;