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
Ripon12
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".
ThankYouDriveThrough
rtpninja
You should try like
bb.Format("%.3f",kk);
Spock101
Why is
bb.Format("%.3f",kk);
not working for you
zjm
This control might help you out:
http://www.codeguru.com/Cpp/controls/editctrl/maskededitcontrols/article.php/c3915/
Tom
Dean Massey
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.
wstrnsky99
Robert Dunlop
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