A1VBCode Forums

Results not showing in Decimal Form Help Pls


http://a1vbcode.com/vbforums/Topic28308.aspx

By deafgal - 10/21/2009

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Total_CMADataSet.Table1' table. You can move, or remove it, as needed.
Me.Table1TableAdapter.Fill(Me.Total_CMADataSet.Table1)
End Sub
Private Sub Strands_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Strands.TextChanged
Dim area As Decimal = CDec(ListBox1.SelectedValue)
Dim strand As Decimal
Label3.BackColor = Color.Blue
Label3.ForeColor = Color.AntiqueWhite
Label3.BorderStyle = BorderStyle.Fixed3D
If Decimal.TryParse(Strands.Text, strand) Then
strand *= CDec(area)
Label3.Text = strand.ToString
End If
End Sub
End Class

 
The end result is baffling me here are 2 examples when I debug

Mine: 640.1 * 49 = 31364.9
Debugger: 640.1 * 49 = 31360 ( not right needs to show the correct decimal )

Mine: .775 * 3 = 2.325
Debugger: .775 * 3 = 2.325 ( shows it perfectly???)