We help IT Professionals succeed at work.
Get Started

Format Textbox for currency.

563 Views
Last Modified: 2013-12-17
I can't get the txtbox to format correctly. It shows $ but if the result of the sum total on the datagrid is $45.50 I only see $4.00 in the textbox.

 For Each dr As DataGridViewRow In DataGridView1.Rows
            Dim c As DataGridViewCheckBoxCell = CType(dr.Cells(0), DataGridViewCheckBoxCell)
            If ((Not (c) Is Nothing) _
                        AndAlso CType(c.FormattedValue, Boolean)) Then
                sum = (sum + Integer.Parse(dr.Cells(2).Value.ToString(0.0)))          
 End If
        Next
   i = (i + 1)
  txttbl.Text = sum.ToString("c")
 txttbl.Text = CDec(txttbl.Text).ToString("c")
Comment
Watch Question
Staff Software Engineer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE