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.
This commit is contained in:
baldurk
2016-07-21 13:58:21 +02:00
parent f5c5618650
commit 7923ad15a8
+3 -1
View File
@@ -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 += "}";
}
};