From 7923ad15a84fe5047a29cd1efac9395cc080e411 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 21 Jul 2016 13:58:21 +0200 Subject: [PATCH] Fix exponential float formatter to properly use min/max figures * Previously it was treating maxfigures as the required length of the fractional part, so you'd get a lot of pointless 0s. it should be the number of significant figures, so we pretty much reuse the non-exp formatter. --- renderdocui/Interop/Formatter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/renderdocui/Interop/Formatter.cs b/renderdocui/Interop/Formatter.cs index 8c00f840e..3d11794fd 100644 --- a/renderdocui/Interop/Formatter.cs +++ b/renderdocui/Interop/Formatter.cs @@ -142,13 +142,15 @@ namespace renderdoc private static void UpdateFormatters() { - m_EFormatter = "{0:" + String.Format("E{0}", m_MaxFigures) + "}"; m_FFormatter = "{0:0."; int i = 0; for (; i < m_MinFigures; i++) m_FFormatter += "0"; for (; i < m_MaxFigures; i++) m_FFormatter += "#"; + + m_EFormatter = m_FFormatter + "e+00}"; + m_FFormatter += "}"; } };