Don't print trailing zeros in fractions (e.g. 2.5 instead of 2.50).

This commit is contained in:
Bartosz Taudul 2019-02-10 01:12:22 +01:00
parent af16872693
commit 2ad0258925

View File

@ -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 )