From 60e6d0f238d350347d17f2da06029f3ed0808ced Mon Sep 17 00:00:00 2001
From: Sam Wilkins <samwilkins333@gmail.com>
Date: Thu, 13 Feb 2020 09:30:25 -0500
Subject: pivot label fix

---
 .../collectionFreeForm/CollectionFreeFormLayoutEngines.tsx            | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx
index ce2bce052..22c8870d9 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx
@@ -44,7 +44,9 @@ export interface ViewDefResult {
 }
 function toLabel(target: FieldResult<Field>) {
     if (typeof target === "number" || Number(target)) {
-        return Number(target).toFixed(2).toString();
+        const truncated = Number(Number(target).toFixed(0));
+        const precise = Number(Number(target).toFixed(2));
+        return truncated === precise ? Number(target).toFixed(0) : Number(target).toFixed(2);
     }
     if (target instanceof ObjectField || target instanceof RefField) {
         return target[ToString]();
-- 
cgit v1.2.3-70-g09d2

