char *psf = "183.0000000000000001"; char chBuff[128]; sprintf(chBuff, "%.2lf", atof(psf)); double fi = atof(chBuff);