mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 21:10:42 +00:00
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:
@@ -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 += "}";
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user