fixed float printing errors
This commit is contained in:
@@ -68,6 +68,9 @@ char* toString_uint(uint64 n, bool withPostfix, bool uppercase){
|
||||
if(precision==0)\
|
||||
precision=toString_float_default_precision;\
|
||||
int cn=sprintf(str, "%.*f", precision, n);\
|
||||
/* remove trailing zeroes except .0*/\
|
||||
while(str[cn-1]=='0' && str[cn-2]!='.')\
|
||||
cn--;\
|
||||
if(withPostfix)\
|
||||
str[cn++]= uppercase ? 'F' : 'f';\
|
||||
str[cn]='\0';\
|
||||
|
||||
Reference in New Issue
Block a user