Click here to Skip to main content
16,006,065 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Convert CString to double Pin
Ștefan-Mihai MOGA21-Jun-08 6:42
professionalȘtefan-Mihai MOGA21-Jun-08 6:42 
GeneralRe: Convert CString to double Pin
bkelly1321-Jun-08 16:05
bkelly1321-Jun-08 16:05 
GeneralRe: Convert CString to double Pin
Ștefan-Mihai MOGA21-Jun-08 20:18
professionalȘtefan-Mihai MOGA21-Jun-08 20:18 
GeneralRe: Convert CString to double Pin
bkelly1322-Jun-08 2:44
bkelly1322-Jun-08 2:44 
GeneralRe: Convert CString to double Pin
CPallini21-Jun-08 4:48
mveCPallini21-Jun-08 4:48 
GeneralRe: Convert CString to double Pin
bkelly1321-Jun-08 4:51
bkelly1321-Jun-08 4:51 
GeneralRe: Convert CString to double Pin
CPallini21-Jun-08 6:41
mveCPallini21-Jun-08 6:41 
GeneralRe: Convert CString to double Pin
bkelly1321-Jun-08 7:18
bkelly1321-Jun-08 7: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 0:42
mveCPallini22-Jun-08 0:42 
GeneralSomebody voted me down for playing with you. Pin
Rajesh R Subramanian26-Jun-08 0:24
professionalRajesh R Subramanian26-Jun-08 0:24 
GeneralRe: Somebody voted me down for playing with you. Pin
CPallini26-Jun-08 1:00
mveCPallini26-Jun-08 1:00 
GeneralRe: Somebody voted me down for playing with you. Pin
Rajesh R Subramanian26-Jun-08 1:10
professionalRajesh R Subramanian26-Jun-08 1:10 
GeneralRe: Convert CString to double Pin
Nelek21-Jun-08 7:04
protectorNelek21-Jun-08 7:04 
GeneralRe: Convert CString to double Pin
bkelly1321-Jun-08 9:15
bkelly1321-Jun-08 9:15 
GeneralRe: Convert CString to double Pin
Nelek21-Jun-08 9:40
protectorNelek21-Jun-08 9:40 
QuestionRe: Convert CString to double Pin
David Crow21-Jun-08 12:51
David Crow21-Jun-08 12:51 
Questionproblem with status,progressbar [modified] Pin
sanjayvenkat20-Jun-08 23:18
sanjayvenkat20-Jun-08 23:18 
AnswerRe: problem with status,progressbar Pin
Nibu babu thomas21-Jun-08 2:07
Nibu babu thomas21-Jun-08 2:07 
QuestionHow to change width of a combo box at run time Pin
sheshidar20-Jun-08 23:11
sheshidar20-Jun-08 23:11 
AnswerRe: How to change width of a combo box at run time Pin
Hamid_RT20-Jun-08 23:44
Hamid_RT20-Jun-08 23:44 
AnswerRe: How to change width of a combo box at run time Pin
Ștefan-Mihai MOGA21-Jun-08 4:23
professionalȘtefan-Mihai MOGA21-Jun-08 4:23 
QuestionCTreeCtrl image set issue Pin
Abyss20-Jun-08 22:16
Abyss20-Jun-08 22:16 
QuestionDecompressing NTFS Compressed RAW Data Pin
Member 147600120-Jun-08 20:30
Member 147600120-Jun-08 20:30 
QuestionAbout position of AfxMessageBox OK button Pin
Mushtaque Nizamani20-Jun-08 18:55
Mushtaque Nizamani20-Jun-08 18:55 
AnswerRe: About position of AfxMessageBox OK button Pin
zafersavas20-Jun-08 19:28
zafersavas20-Jun-08 19: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.