mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Don't print trailing zeros in fractions (e.g. 2.5 instead of 2.50).
This commit is contained in:
parent
af16872693
commit
2ad0258925
@ -93,8 +93,16 @@ static inline void PrintSmallInt( char*& buf, uint64_t v )
|
|||||||
static inline void PrintFrac00( char*& buf, uint64_t v )
|
static inline void PrintFrac00( char*& buf, uint64_t v )
|
||||||
{
|
{
|
||||||
*buf++ = '.';
|
*buf++ = '.';
|
||||||
memcpy( buf, IntTable100 + (v+5)/10*2, 2 );
|
v += 5;
|
||||||
buf += 2;
|
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 )
|
static inline void PrintFrac0( char*& buf, uint64_t v )
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user