From 2ad025892551656c7a9550fac1acec31459bf4de Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 10 Feb 2019 01:12:22 +0100 Subject: [PATCH] Don't print trailing zeros in fractions (e.g. 2.5 instead of 2.50). --- server/TracyView.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index c708b533..34991e00 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -93,8 +93,16 @@ static inline void PrintSmallInt( char*& buf, uint64_t v ) static inline void PrintFrac00( char*& buf, uint64_t v ) { *buf++ = '.'; - memcpy( buf, IntTable100 + (v+5)/10*2, 2 ); - buf += 2; + v += 5; + if( v/10%10 == 0 ) + { + *buf++ = '0' + v/100; + } + else + { + memcpy( buf, IntTable100 + v/10*2, 2 ); + buf += 2; + } } static inline void PrintFrac0( char*& buf, uint64_t v )