From 20a1b9d2557f90f92be66ffac3e5f840fc883f93 Mon Sep 17 00:00:00 2001 From: Luke De Feo Date: Thu, 26 Oct 2023 05:24:30 -0700 Subject: [PATCH] format numbers Reviewed By: lblasa Differential Revision: D50653525 fbshipit-source-id: 265a2821acef572ca6d9576be647ee1d07f3850e --- .../components/sidebarV2/AttributesInspector.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desktop/plugins/public/ui-debugger/components/sidebarV2/AttributesInspector.tsx b/desktop/plugins/public/ui-debugger/components/sidebarV2/AttributesInspector.tsx index a48b110c6..61abfdde8 100644 --- a/desktop/plugins/public/ui-debugger/components/sidebarV2/AttributesInspector.tsx +++ b/desktop/plugins/public/ui-debugger/components/sidebarV2/AttributesInspector.tsx @@ -326,6 +326,11 @@ function StyledInput({ mutable: boolean; rightAddon?: string; }) { + let formatted: any = value; + if (typeof value === 'number') { + //cap the number of decimal places to 5 but dont add trailing zeros + formatted = Number.parseFloat(value.toFixed(5)); + } return ( );