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!
Re: Multipling numbers with a DECIMAL POINT
use val(text1.text) or use csng(text1.text)
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