|
-
December 11th, 1999, 04:54 PM
#1
Multipling numbers with a DECIMAL POINT
Im tring to create a simple aplication that transforms measurements from the us sytem to the metric system. My problem is that the program doesnt seem to recognise comas ( decimal points; eg 17.5 is seen by the program as 175 ) Im using a text box to let the user put in the numbers and a comand buton to perform the equation eg:
Private Sub Command1_Click()
Text1.Text = Text1.Text * 2
End Sub
if you wirgt 1.5 in the texbox
the result will be 30 insted of 3
please help!
-
December 12th, 1999, 11:48 AM
#2
Re: Multipling numbers with a DECIMAL POINT
use val(text1.text) or use csng(text1.text)
-
December 12th, 1999, 01:38 PM
#3
Re: Multipling numbers with a DECIMAL POINT
You might wish to use variables of certain types,
like
Dim Num as Double
Dim Result as Double
private Sub Command1_Click()
Num = Val(Text1.Text)
Result = Num * 2
Debug.print Result
End Sub
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
|