float Info.SS = 1f;
char buf[128];
char* float2str(float val, int precision, char* buf)
{
char* cur, * end;
sprintf(buf, "%.6f", val);
if (precision < 6) {
cur = buf + strlen(buf) - 1;
end = cur - 6 + precision;
while ((cur > end) && (*cur == '0')) {
*cur = '\0';
cur--;
}
}
return buf;
}
((CButton*)g_pWnd->GetDlgItem(IDC_STATIC_SS_EDIT))->SetWindowText(float2str((float)Info.SS, 1, buf));
//g_pWnd 请看我的上一个博文。
08-04
2211
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)