|
아래 코드에서 float형으로 변환된 f의 소수점 이하 자리수를
4자리로 제한하려고 합니다.
책을 찾아봐도 그런 내용이 없는 것 같아서요..
어떻게 해야 하는지 알려주시면 감사하겠습니다.
/-------------------------------------------
void TForm1::PrintMsg(Byte *ch, long len)
{
float f;
f = atof(ch);
if(Count%16 >= 1 && Count%16 <= 15)
StringGrid1->Cells[1][Count%16] = f;
else
StringGrid1->Cells[1][16] = f;
}
/-------------------------------------------
|