Commit 68c2e806 authored by Niklas Haas's avatar Niklas Haas
Browse files

format: fix weird floating point printing edge case

We really need a better function for this.
parent 20a0b9b3
......@@ -496,6 +496,7 @@ static int ccStrPrintDouble( char *str, int bufsize, int decimals, double value
for( index = 0 ; index < decimals ; index++ )
{
frac = (int32_t)( value * muldec ) - accumsub;
frac = PL_MIN(PL_MAX(frac, 0), 9); // FIXME: why is this needed?
str[index] = '0' + (char)frac;
accumsub += frac;
accumsub = ( accumsub << 3 ) + ( accumsub << 1 );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment