Click here to Skip to main content
15,892,805 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Noob wants organization Pin
Curi0us_George9-Mar-04 17:15
Curi0us_George9-Mar-04 17:15 
GeneralRe: Noob wants organization Pin
Slaru20-Mar-04 13:32
Slaru20-Mar-04 13:32 
GeneralFile I/O Problem Pin
scrname9-Mar-04 13:44
scrname9-Mar-04 13:44 
GeneralRe: File I/O Problem Pin
modeonetwo9-Mar-04 15:10
modeonetwo9-Mar-04 15:10 
GeneralRe: File I/O Problem Pin
Christian Graus9-Mar-04 15:12
protectorChristian Graus9-Mar-04 15:12 
GeneralRe: File I/O Problem Pin
scrname9-Mar-04 17:10
scrname9-Mar-04 17:10 
GeneralRe: File I/O Problem Pin
Christian Graus9-Mar-04 17:15
protectorChristian Graus9-Mar-04 17:15 
GeneralSetPercision in MFC Pin
MeterMan9-Mar-04 12:16
MeterMan9-Mar-04 12:16 
I know in c++ you could use setpercision to change the number of decimal places outputted. So how do you do it with the Cstring variable output in a dialogbox in mfc?

I have the following:
float Float_Percentage=0;
float_percentage = m_wins/m_plays;

CString PercentageConversion;
PercentageConversion.Format("%f",Float_Percentage); // convert float to str

percentvalue=PercentageConversion; // percent is of type CString

I get output like this 0.050000

How do i make it 0.05 as in just show two decimal places in a setpercision(2)?

Thanks for your help.






Win32newb
"Making (C)Windows programs worse than they already are!"
GeneralRe: SetPercision in MFC Pin
Ryan Binns9-Mar-04 17:52
Ryan Binns9-Mar-04 17:52 
GeneralRe: SetPercision in MFC Pin
MeterMan10-Mar-04 10:42
MeterMan10-Mar-04 10:42 
GeneralOnFIleOpen Current Directory Pin
Coremn9-Mar-04 12:11
Coremn9-Mar-04 12:11 
GeneralProblem with parsing a BYTE* Pin
__Cerb9-Mar-04 12:07
__Cerb9-Mar-04 12:07 
GeneralRe: Problem with parsing a BYTE* Pin
Curi0us_George9-Mar-04 12:35
Curi0us_George9-Mar-04 12:35 
GeneralRe: Problem with parsing a BYTE* Pin
__Cerb9-Mar-04 13:00
__Cerb9-Mar-04 13:00 
GeneralRe: Problem with parsing a BYTE* Pin
Curi0us_George9-Mar-04 17:03
Curi0us_George9-Mar-04 17:03 
QuestionAnyone has some experience with Windows 98 Enabled and Hebrew??? Pin
LukeV9-Mar-04 10:31
LukeV9-Mar-04 10:31 
QuestionCan Anyone Help me Plz Pin
MrNiceBerG9-Mar-04 10:16
MrNiceBerG9-Mar-04 10:16 
AnswerRe: Can Anyone Help me Plz Pin
MeterMan9-Mar-04 12:23
MeterMan9-Mar-04 12:23 
QuestionInteractive 2d graph control? Pin
khan20009-Mar-04 9:54
khan20009-Mar-04 9:54 
GeneralMSHTML debug help needed Pin
Arun Bhalla9-Mar-04 9:48
Arun Bhalla9-Mar-04 9:48 
GeneralLayered Service Provider Pin
Member 8826679-Mar-04 8:53
Member 8826679-Mar-04 8:53 
GeneralGetting App Path Pin
Ghasrfakhri9-Mar-04 8:45
Ghasrfakhri9-Mar-04 8:45 
GeneralRe: Getting App Path Pin
Brian D9-Mar-04 9:06
Brian D9-Mar-04 9:06 
GeneralTnx Pin
Ghasrfakhri9-Mar-04 9:09
Ghasrfakhri9-Mar-04 9:09 
GeneralSystem tray menu Pin
sschilachi9-Mar-04 6:58
sschilachi9-Mar-04 6:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.