Results 1 to 30 of 30

Thread: Format("$#####0.00) FIGURED OUT

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2004
    Posts
    131

    Format("$#####0.00) FIGURED OUT

    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:
    1. Private Sub btnGross_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGross.Click
    2.         ' name abbreviations
    3.         SA = Val(nudSales.Text)
    4.         SP = Val(grpSalespersons.Text)
    5.         TS = Val(grpTotalSales.Text)
    6.         ' Compute value and display in Gross Pay
    7.         GP = BP + SA * CM
    8.         txtGross.Text = Format(GP, "$#####0.00")
    9.         ' Compute value and display in Salespersons
    10.         grpSalespersons.Text = (SP + 1).ToString
    11.         ' Compute value and display in Total Sales
    12.         grpTotalSales.Text = (SA + TS).ToString
    13.         grpTotalSales.Text = Format(TS, "$#####0.00")
    14.         ' Compute value and display in Average Sales
    15.         grpAverageSales.Text = Format("$#####0.00")
    16.         If SP = 0 Then
    17.             grpAverageSales.Text = (SA).ToString
    18.         Else
    19.             grpAverageSales.Text = ((SA + TS) / (SP + 1)).ToString
    20.  
    21.         End If
    22.  
    23.        
    24.     End Sub
    Last edited by twisted; Jun 9th, 2004 at 12:12 PM.
    Twisted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width