Hi, I started do learn VB and I want to make a program that counts the amount of fuel by multiplying no. of laps and fuel consumption per 1 lap.
Dim b As Double = CDbl(TextBox2.Text)
here is the error (the consumption is decimal number (1.3 etc.).
When I type classic integer (1, 54, 20...) it wokrs fine. But when the number is decimal, there is an error.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Integer = CInt(TextBox1.Text)[B]
Dim b As Double = CDbl(TextBox2.Text)[/B]
Dim c As Double = a * b
TextBox3.Text = c
End Sub
End Class
Dim b As Double = CDbl(TextBox2.Text)
here is the error (the consumption is decimal number (1.3 etc.).
When I type classic integer (1, 54, 20...) it wokrs fine. But when the number is decimal, there is an error.