From cbbc7790560228b24cfeca7e1ddff7240c7ed8b8 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 28 Aug 2017 18:35:40 +0100 Subject: [PATCH] If the precision is lower than even the number after rounding, print 0.0 --- renderdoc/serialise/utf8printf.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/renderdoc/serialise/utf8printf.cpp b/renderdoc/serialise/utf8printf.cpp index 9b5e2f0fc..1e3100cd8 100644 --- a/renderdoc/serialise/utf8printf.cpp +++ b/renderdoc/serialise/utf8printf.cpp @@ -533,6 +533,12 @@ void PrintFloat(double argd, FormatterParams &formatter, bool e, bool f, bool g, expon++; } } + else if(removedigs > ndigits) + { + ndigits = 1; + digits[0] = '0'; + expon = 0; + } else { // remove the specified number of digits