Hello,
To dispaly the value of variable B of type double in a MFC text
control, I am using the following three lines
CString maxA;
double B=0.00;
maxA.Format("%f ",B);

Everything is and the numbers are diplayed like '2.987654'. I would,
however, want the numbers to be displayed upto only three digits
after decimal point. Would someone tell me please how can it be done?
Thanks.

Re: restricting number of digits after decimal point using CString.format() by stefkeB

stefkeB
Tue Jun 22 10:04:20 CDT 2004

maxA.Format("%.3f ",B);




Re: restricting number of digits after decimal point using CString.format() by miahmed67

miahmed67
Wed Jun 23 04:03:31 CDT 2004

"stefkeB" <stefkeB@hotmail.com> wrote in message news:<eUUNuoGWEHA.3492@TK2MSFTNGP10.phx.gbl>...
> maxA.Format("%.3f ",B);

Thank you.