mirror of
https://gitee.com/anod/open_agb_firm.git
synced 2025-05-06 13:54:09 +08:00
修复浮点数为xxx.999这种输入的字符串转换问题
This commit is contained in:
parent
c8a1d11408
commit
a30575b935
@ -129,6 +129,11 @@ static char* float2str( float f, char out[16] )
|
|||||||
int n = floor(f);
|
int n = floor(f);
|
||||||
f = f - n;
|
f = f - n;
|
||||||
if( f > 0.5) ++n;
|
if( f > 0.5) ++n;
|
||||||
|
if( n == 100 )
|
||||||
|
{
|
||||||
|
++s;
|
||||||
|
n = 0;
|
||||||
|
}
|
||||||
ee_snprintf(out, 16, "%d.%02d", s, n);
|
ee_snprintf(out, 16, "%d.%02d", s, n);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user