1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

Use default 0 precision in the float formatting (bug #4096)

This commit is contained in:
Andrei Kortunov 2017-09-17 14:34:27 +04:00
parent f594eda574
commit 4bb349a525

View File

@ -34,21 +34,19 @@ namespace Misc
if (i < m.size())
{
int precision = 0;
bool precisionSet = false;
int precision = -1;
if (m[i] == '.')
{
precision = 0;
while (++i < m.size() && m[i] >= '0' && m[i] <= '9')
{
precision = precision * 10 + (m[i] - '0');
precisionSet = true;
}
}
if (i < m.size())
{
width = (widthSet) ? width : -1;
precision = (precisionSet) ? precision : -1;
if (m[i] == 'S' || m[i] == 's')
visitedPlaceholder(StringPlaceholder, pad, width, precision);