MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / formatValue

Function formatValue

examples/drivers/m5stickc-imu/main.js:112–118  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

110
111
112function formatValue(value) {
113 if (!value)
114 return value;
115 if (value < 0)
116 return value.toFixed(3);
117 return `+${value.toFixed(3)}`;
118}
119
120function drawBar(label, value, x, y, width, height) {
121 const halfWidth = width >> 1;

Callers 1

onReadingFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected