|
-
Feb 6th, 2007, 04:16 AM
#1
Thread Starter
Addicted Member
Why convert from String to Double?
Hello All,
I am, at a minimum, new to VB but it has really gotten ahold of me. I am absorbing all aspects quite well accept one.
Please keep in mind that as far as programming goes I am infantile at best. I do however understand why you would need to define what your variables are going to be according to what will be displayed or amount of memory needed to contain your information, BUT for the life of me I can not understand why my VB6 2005 edition requires me to convert this line of code from a string to a double. Any help will be greatly appreciated.
VB Code:
StrNumber1 = CStr (txtNumber1.Text)
StrNumber2 = CStr(txtNumber2.Text)
StrYourAnswer = CStr(CDbl(StrNumber1) * CDbl(StrNumber2))
To pinpoint my question. I am converting to a string which, correct me if I'm wrong can be any number or letter, to a double. The way you see it formatted here is the way that VB made me correct it to thrawt any exceptions. Once again any help would be great at this point. I understand what changes are being made, I just don't understand thru all the text I read why I am making them.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|