Hi, In an application im making, I need to square a decimal value in a text field to then use in other calculations later, but when the compiler squares the value it ignores the decimal points, treating 1.85^2 as 185^2 and returning 34225 rather than 3.4225. What am I doing wrong? Here is the code:
Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click Dim heightSquared, height As Double height = txtHeight.Text heightSquared = (height * height) lblBMI.Text = heightSquared End Sub
This is the test code im using, and have tried using height^2 and got the same result.