From CString to Float?

maddop
maddop used Ask the Experts™
on
Is it possible to convert a CString to a Float to enable a division.

CTime dob(1980,1,2,3,4,5);
CTime now = CTime::GetCurrentTime();
CTimeSpan ts = now-dob;

//Need to convert the statement below

CString s = ts.Format( "Total days: %D);

//I need to divide the Total days by 365 can i do it?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2012
Commented:
Well, I'd use

LONG lDays = ts.GetDays();

Author

Commented:
Cheers... just the job

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial