From 8c05990e8d0fb08004da35b01fa2e70177d638c9 Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Mon, 17 Oct 2016 20:49:40 -0700 Subject: [PATCH] fix operation representation --- web/app/3d/operations.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/app/3d/operations.js b/web/app/3d/operations.js index 8c1db924..cdd8b47f 100644 --- a/web/app/3d/operations.js +++ b/web/app/3d/operations.js @@ -3,13 +3,13 @@ import * as math from '../math/math' export const CUT = { icon: 'img/3d/cut', label: 'Cut', - info: (p) => '(' + math.norm2(p.target) + ')' + info: (p) => '(' + r(math.norm2(p.target)) + ')' }; export const PAD = { icon: 'img/3d/extrude', label: 'Extrude', - info: (p) => '(' + math.norm2(p.target) + ')' + info: (p) => '(' + r(math.norm2(p.target)) + ')' }; export const SHELL = { @@ -53,3 +53,7 @@ export const UNION = { label: 'Union', info: (p) => null }; + +function r(value) { + return value.toPrecision(4).replace(/\.0$/, ''); +} \ No newline at end of file