Results 1 to 4 of 4

Thread: changing text to currency

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 1999
    Location
    Davenport, IA 52804
    Posts
    30

    changing text to currency

    Hi,

    I have a calculator function in my program. Users of my software have been complaining because the dollar amount is hard to read especially when they get into high numbers.

    ex.
    $6426587895.00 is 6 billion, 426 million, ect....

    but it's kind of hard to tell without counting spaces

    I would like it to come out

    $6,426,587,895.00

    if the number was
    $6420

    I want it to come out $6,420.00

    How would I format a string to do this?

  2. #2
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    Gig Harbor, WA; Posts: 89950
    Posts
    360
    Try this:
    Code:
    Private Sub Form_Load()
    Dim strInput As String
    Text1.Text = strInput
    Format strInput, ("Currency")
    Label1.Caption = strInput
    End Sub
    This wont work on VB7
    Lee
    Mahalo
    VB6(SP5), VC++, COBOL, Basic, JAVA
    MBA, MCSD, MCSE, A+
    Computer Forensics

  3. #3
    Matthew Gates
    Guest
    Use the FormatCurrency function.


    Code:
    MsgBox FormatCurrency("$6420", 2)

  4. #4
    Megatron
    Guest
    Or the Format function.
    Code:
    MsgBox Format("$6420", "$0.00")

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