Results 1 to 8 of 8

Thread: Percentages problem!

  1. #1

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Question

    Hi folks,

    Ive got three textbox's and a command button what I am trying to do and failing is place a figure in one box(total) and a figure in another(sold) and the third gives you the Percentage of what has been sold.

    Thanks

    Spud

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Should be easy
    Code:
    Text3=Val(Text1)/Val(text2)*100 & "%"
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Question


    Cheers Kedaman that does the trick! Thanks


    How do I reduce the number of decimals after the point

    Thanks again!

    Spud

  4. #4

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Talking

    Excelent Kedaman,
    Thanks again, before I put you up there in a god like status I posted a question on the database forum two days ago there dosn't seem to be much movement in that department. Would you mind having a look as I see that you answer a lot of posts just to confirm that your status is a guru and not a god?

    Cheers Again

    Spud


    (I did answer a post once, a very simple question I think it was What does VB stand for?)

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Aw, that was Meg, but he's a Guru too, but don't expect me to go in the database forum because i'm not a databaseguru
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    Addicted Member
    Join Date
    May 1999
    Posts
    161
    You should also be able to use the 'Format' function. It will allow you to specify exactly how you want you result to look like.

  7. #7
    Guest
    I agree, the format option is probably better because then you can have it look the "right" way. For example, if the value in one instance was one and one-tenth percent it would be displayed as 1.1% If the value was one and fifteen-hundreths percent it would be displayed as 1.15%. If you used the Format(myval, "0.00%") command the two would be respectively displayed as:

    1.10%
    1.15%

    A cleaner look.


  8. #8

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Red face

    My mistake Kedaman & Megatron it late at night when I post, the old eyes aren't as good as they used to be.


    Thanks to both.

    Spud

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