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