Skip to content

Commit cbbc779

Browse files
committed
If the precision is lower than even the number after rounding, print 0.0
1 parent c8a1608 commit cbbc779

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

renderdoc/serialise/utf8printf.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,12 @@ void PrintFloat(double argd, FormatterParams &formatter, bool e, bool f, bool g,
533533
expon++;
534534
}
535535
}
536+
else if(removedigs > ndigits)
537+
{
538+
ndigits = 1;
539+
digits[0] = '0';
540+
expon = 0;
541+
}
536542
else
537543
{
538544
// remove the specified number of digits

0 commit comments

Comments
 (0)