UNPKG

opendash

Version:

open.DASH data visualization framework

16 lines 414 B
export function formatDistance(mm) { if (Math.abs(mm) < 10) { return Math.round(mm) + "mm"; } var cm = mm / 10; if (Math.abs(cm) < 10) { return Math.round(cm) + "cm"; } var m = cm / 100; if (Math.abs(m) < 100) { return Math.round(m) + "m"; } var km = m / 1000; return Math.round(km) + "km"; } //# sourceMappingURL=formatDistance.js.map