Mr beginner again
I have gone back to basics after my previous failed attempts, although i have coded my layout.
My question;
I have two user entries; Litres as edittext and miles as edittext
I want to take these two entries and [1] convert litres to gallons using a factor 4.45 and [2] calculate miles per gallon
when i try and calculate the mpg = miles/gallons i get a 'numberformat - invalid double error
What am i missing?
The factor, ltr, gal, mls etc have been dim'd in sub_globals hence the "'"
litres_EnterPressed
'Dim factor As Float 'Sets up conversion factor and converts to gallons
factor = 4.45
'Dim ltr As Float
ltr = "litres"
'Dim gal As Float
gal = (litres/factor)
End Sub
Sub miles_EnterPressed
'Dim mls As float ' Sets miles as integer'
mls = miles
End Sub
Sub calc_click 'Calculates the mpg and displays in label answer'
Dim result As Int
result = ("mls"/"gal")
answer.Text = "Your miles per gallon was " & result
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
I have gone back to basics after my previous failed attempts, although i have coded my layout.
My question;
I have two user entries; Litres as edittext and miles as edittext
I want to take these two entries and [1] convert litres to gallons using a factor 4.45 and [2] calculate miles per gallon
when i try and calculate the mpg = miles/gallons i get a 'numberformat - invalid double error
What am i missing?
The factor, ltr, gal, mls etc have been dim'd in sub_globals hence the "'"
litres_EnterPressed
'Dim factor As Float 'Sets up conversion factor and converts to gallons
factor = 4.45
'Dim ltr As Float
ltr = "litres"
'Dim gal As Float
gal = (litres/factor)
End Sub
Sub miles_EnterPressed
'Dim mls As float ' Sets miles as integer'
mls = miles
End Sub
Sub calc_click 'Calculates the mpg and displays in label answer'
Dim result As Int
result = ("mls"/"gal")
answer.Text = "Your miles per gallon was " & result
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub