Click to See Complete Forum and Search --> : Multipling numbers with a DECIMAL POINT


December 11th, 1999, 03:54 PM
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, 10:48 AM
use val(text1.text) or use csng(text1.text)

Jean Spector
December 12th, 1999, 12:38 PM
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