float precision
-
hello , how can i set float precisoin in mfc ? I get like this format ex. 1.500000 what i want is to print just 3 number after the decimal point . my code : CString temp; float price =20.570; sprintf(temp,"%f",price); i got this 20.570000 how can i make the decimal point print just 3 number like this 20.570 and thank you .
-
hello , how can i set float precisoin in mfc ? I get like this format ex. 1.500000 what i want is to print just 3 number after the decimal point . my code : CString temp; float price =20.570; sprintf(temp,"%f",price); i got this 20.570000 how can i make the decimal point print just 3 number like this 20.570 and thank you .
double d = 1.5000000;
CString str;
str.Format("%.3f");or
printf("%.3f", d);
Sonork 100.41263:Anthony_Yio