I am trying to get my grpTotalSales.Text and grpAverageSales.Text to display a dollar sign and then a money value. It works for my gross pay but it doesn't work for the others. Here is the code:
VB Code:
Private Sub btnGross_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGross.Click ' name abbreviations SA = Val(nudSales.Text) SP = Val(grpSalespersons.Text) TS = Val(grpTotalSales.Text) ' Compute value and display in Gross Pay GP = BP + SA * CM txtGross.Text = Format(GP, "$#####0.00") ' Compute value and display in Salespersons grpSalespersons.Text = (SP + 1).ToString ' Compute value and display in Total Sales grpTotalSales.Text = (SA + TS).ToString grpTotalSales.Text = Format(TS, "$#####0.00") ' Compute value and display in Average Sales grpAverageSales.Text = Format("$#####0.00") If SP = 0 Then grpAverageSales.Text = (SA).ToString Else grpAverageSales.Text = ((SA + TS) / (SP + 1)).ToString End If End Sub




Reply With Quote