diff --git a/src/lib/monitor-adapter.js b/src/lib/monitor-adapter.js index ea4a30270a2519287520e0691add15f3b0b4a959..ce4388b0f392630424bcc46d462767ee2c735d7c 100644 --- a/src/lib/monitor-adapter.js +++ b/src/lib/monitor-adapter.js @@ -35,6 +35,11 @@ export default function ({id, spriteName, index, opcode, params, value, x, y}) { // @todo e.g. this does not work well when monitors have already been moved if (isUndefined(x)) x = PADDING; if (isUndefined(y)) y = PADDING + (index * (PADDING + MONITOR_HEIGHT)); - + + // If value is a number, round it to six decimal places + if (!isNaN(value)) { + value = Number(Number(value).toFixed(6)); + } + return {id, label, category, value, x, y}; }