Results 1 to 9 of 9

Thread: help me :)

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    51

    help me :)

    im tryin to make a calculator like program i figgured everything out but i wanna no how to put ,'s every three numbers of the results ie instead of it comming back as 1000000000 it goes 1,000,000,000 help would be apreciated

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: help me :)

    you can use the format function
    try
    mynum = format(mynumber, "standard")

    or
    mynum = Format(1E+16, " ###,###,###,###,###,##0")

    pete

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    51

    Re: help me :)

    ahh thanks worked great

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    51

    Re: help me :)

    ok so far this is what my code looks like
    Code:
    dsummer.Text = (tree.Text * 2.52) + (bush.Text * 8.07) + (flower.Text * 48.08) + (grass.Text * 80.64) 
    nsummer.Text = (tree.Text * 43.2) + (bush.Text * 138.24) + (flower.Text * 833.28) + (grass.Text * 1382.4) 
    dspring.Text = (tree.Text * 2.52) + (bush.Text * 8.07) + (flower.Text * 31.36) + (grass.Text * 123.27) 
    nspring.Text = (tree.Text * 43.2) + (bush.Text * 138.24) + (flower.Text * 537.6) + (grass.Text * 2177.28) 
    daut.Text = (tree.Text * 4.86) + (bush.Text * 8.07) + (flower.Text * 31.36) + (grass.Text * 80.64) 
    naut.Text = (tree.Text * 90) + (bush.Text * 138.24) + (flower.Text * 537.6) + (grass.Text * 1382.4) 
    Dwinter.Text = (tree.Text * 4.86) + (bush.Text * 8.07) + (flower.Text * 31.36) + (grass.Text * 80.64) 
    Nwinter.Text = (tree.Text * 90) + (bush.Text * 138.24) + (flower.Text * 537.6) + (grass.Text * 1382.4) 
    dsummer.Text = Format(dsummer.Text, "standard")
    nsummer.Text = Format(nsummer.Text, "standard")
    dspring.Text = Format(dspring.Text, "standard")
    nspring.Text = Format(nspring.Text, "standard")
    daut.Text = Format(daut.Text, "standard")
    naut.Text = Format(naut.Text, "standard")
    Dwinter.Text = Format(Dwinter.Text, "standard")
    Nwinter.Text = Format(Nwinter.Text, "standard")
    now right now it will return sumthin like this1,000,000.00 i want to get rid of the .00 part how do i do this?

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: help me :)

    VB Code:
    1. strTemp = Format(xxx, "standard")
    2. Left$(strTemp, Len(strTemp) - 3)

  6. #6

    Thread Starter
    Member
    Join Date
    Jun 2005
    Posts
    51

    Re: help me :)

    could ya explaine a little more what i do with this bit of code please

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: help me :)

    or
    mynum = Format(mynum, " ###,###,###,###,###,##0")

    edit: if you want decimal to show if there are some use
    mynum = Format(mynum, " ###,###,###,###,###,##0.####")

    pete
    Last edited by westconn1; Jun 12th, 2005 at 02:06 AM.

  8. #8
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: help me :)

    use Clng(

  9. #9
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: help me :)

    This will take care of any number greater than 0, and still print out a zero.

    VB Code:
    1. msgbox Format(text1.text,"#,##0")

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