Click here to Skip to main content
15,845,681 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Convert CString to double Pin
Ștefan-Mihai MOGA21-Jun-08 7:42
professionalȘtefan-Mihai MOGA21-Jun-08 7:42 
GeneralRe: Convert CString to double Pin
bkelly1321-Jun-08 17:05
bkelly1321-Jun-08 17:05 
GeneralRe: Convert CString to double Pin
Ștefan-Mihai MOGA21-Jun-08 21:18
professionalȘtefan-Mihai MOGA21-Jun-08 21:18 
GeneralRe: Convert CString to double Pin
bkelly1322-Jun-08 3:44
bkelly1322-Jun-08 3:44 
GeneralRe: Convert CString to double Pin
CPallini21-Jun-08 5:48
mveCPallini21-Jun-08 5:48 
GeneralRe: Convert CString to double Pin
bkelly1321-Jun-08 5:51
bkelly1321-Jun-08 5:51 
GeneralRe: Convert CString to double Pin
CPallini21-Jun-08 7:41
mveCPallini21-Jun-08 7:41 
GeneralRe: Convert CString to double Pin
bkelly1321-Jun-08 8:18
bkelly1321-Jun-08 8:18 
Hello Pallini,
I really do appreciate the time you spent answering my question. But we do disagree on something. Elegant is something like this.

CString source = "1.23e6";
double target;
int status;

status = source.ConvertToFloat( &target );

If atof returns 0.0 in the double variable for an error, this it must also write 0.0 to the variable when the text is 0, or 0.0, or any of several other conditions as you have noted. In this event, either before the convert or after, we must have additonal code to check for any text string that would result in 0.0 to determine if we have an error, or if we really have a 0. Having to writing extra code to do that is indeed downright ugly.

Maybe I have missunderstood you. If so please help me out.

Thanks for your time

GeneralRe: Convert CString to double Pin
CPallini22-Jun-08 1:42
mveCPallini22-Jun-08 1:42 
GeneralSomebody voted me down for playing with you. Pin
Rajesh R Subramanian26-Jun-08 1:24
professionalRajesh R Subramanian26-Jun-08 1:24 
GeneralRe: Somebody voted me down for playing with you. Pin
CPallini26-Jun-08 2:00
mveCPallini26-Jun-08 2:00 
GeneralRe: Somebody voted me down for playing with you. Pin
Rajesh R Subramanian26-Jun-08 2:10
professionalRajesh R Subramanian26-Jun-08 2:10 
GeneralRe: Convert CString to double Pin
Nelek21-Jun-08 8:04
protectorNelek21-Jun-08 8:04 
GeneralRe: Convert CString to double Pin
bkelly1321-Jun-08 10:15
bkelly1321-Jun-08 10:15 
GeneralRe: Convert CString to double Pin
Nelek21-Jun-08 10:40
protectorNelek21-Jun-08 10:40 
QuestionRe: Convert CString to double Pin
David Crow21-Jun-08 13:51
David Crow21-Jun-08 13:51 
Questionproblem with status,progressbar [modified] Pin
sanjayvenkat21-Jun-08 0:18
sanjayvenkat21-Jun-08 0:18 
AnswerRe: problem with status,progressbar Pin
Nibu babu thomas21-Jun-08 3:07
Nibu babu thomas21-Jun-08 3:07 
QuestionHow to change width of a combo box at run time Pin
sheshidar21-Jun-08 0:11
sheshidar21-Jun-08 0:11 
AnswerRe: How to change width of a combo box at run time Pin
Hamid_RT21-Jun-08 0:44
Hamid_RT21-Jun-08 0:44 
AnswerRe: How to change width of a combo box at run time Pin
Ștefan-Mihai MOGA21-Jun-08 5:23
professionalȘtefan-Mihai MOGA21-Jun-08 5:23 
QuestionCTreeCtrl image set issue Pin
Abyss20-Jun-08 23:16
Abyss20-Jun-08 23:16 
QuestionDecompressing NTFS Compressed RAW Data Pin
Member 147600120-Jun-08 21:30
Member 147600120-Jun-08 21:30 
QuestionAbout position of AfxMessageBox OK button Pin
Mushtaque Nizamani20-Jun-08 19:55
Mushtaque Nizamani20-Jun-08 19:55 
AnswerRe: About position of AfxMessageBox OK button Pin
zafersavas20-Jun-08 20:28
zafersavas20-Jun-08 20:28 

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.