Skip to content
Snippets Groups Projects
Unverified Commit c0052b04 authored by sjhuang26's avatar sjhuang26 Committed by GitHub
Browse files

Add number rounding in monitors

parent a60f9d60
No related branches found
No related tags found
No related merge requests found
......@@ -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};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment