my code is like this:
double kk;
kk=1234.123;
bb.Format("%d",kk);
pOUTPUT->SetWindowText(bb);
The output from the program above is not 1234.123. How come like this Is %d incorrect Please help me solve this.
my code is like this:
double kk;
kk=1234.123;
bb.Format("%d",kk);
pOUTPUT->SetWindowText(bb);
The output from the program above is not 1234.123. How come like this Is %d incorrect Please help me solve this.
Problem In MFC AppWizard(exe) 2
Caxaria
Hey Tom - first post here, eh :-) I've moved here from the newsgroups as I find the web interface more organized and more easily searchable.
i386 Solutions
You should try like
bb.Format("%.3f",kk);
Motten
dhirajdewani
I think you may be misunderstanding what Nish, and some others are suggesting. If you use the Format() function of CString with the "f" qualifier you will get floating point.
Maybe you could provide some more information about what you're trying to do.
Tom
e.g.gru
This control might help you out:
http://www.codeguru.com/Cpp/controls/editctrl/maskededitcontrols/article.php/c3915/
Tom
Myoest1
Try this code :-
CString str;
double num = 1234.123;str.Format(_T("%.3f"), num);
MessageBox(str);
It will show a message box with "1234.123".
fellobo
Why is
bb.Format("%.3f",kk);
not working for you
gray-82