Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Please help with a fairly simple percentage calculation....

Please help with a fairly simple percentage calculation....

Scheduled Pinned Locked Moved Visual Basic
csharphelp
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Joey Picerno
    wrote on last edited by
    #1

    I am not very good with percentages in calculations. I am writing in VB(.net 2005). I have 3 textboxes. One is current pay, and one is new pay. Both DOUBLE values. I need to have a calculation that finds the percentage of the increase in pay after the current pay and new pay are entered in the textboxes. I also need a calculation that allows the user to enter the current pay and percentage(the 3rd textbox) of the increase and calculate the new pay. So there are actually two calculations. Please someone help me out with this. I know to someone who is good with calculations and percentages can figure this one out fairly quickly. Thank you!!!

    S G M A 4 Replies Last reply
    0
    • J Joey Picerno

      I am not very good with percentages in calculations. I am writing in VB(.net 2005). I have 3 textboxes. One is current pay, and one is new pay. Both DOUBLE values. I need to have a calculation that finds the percentage of the increase in pay after the current pay and new pay are entered in the textboxes. I also need a calculation that allows the user to enter the current pay and percentage(the 3rd textbox) of the increase and calculate the new pay. So there are actually two calculations. Please someone help me out with this. I know to someone who is good with calculations and percentages can figure this one out fairly quickly. Thank you!!!

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      u can do like.... suppose u r taking 2 textboxes one for input the number and 2nd for input the percentage like 10% of 100. now u can display the result in a label control like dim a,b as integer a=TextBox1.Text b=TextBox2.Text Label1.text=(a*b)/100

      SSK. Anyone who says sunshine brings happiness has never danced in the rain.

      1 Reply Last reply
      0
      • J Joey Picerno

        I am not very good with percentages in calculations. I am writing in VB(.net 2005). I have 3 textboxes. One is current pay, and one is new pay. Both DOUBLE values. I need to have a calculation that finds the percentage of the increase in pay after the current pay and new pay are entered in the textboxes. I also need a calculation that allows the user to enter the current pay and percentage(the 3rd textbox) of the increase and calculate the new pay. So there are actually two calculations. Please someone help me out with this. I know to someone who is good with calculations and percentages can figure this one out fairly quickly. Thank you!!!

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        This is why you need other skills than just programming to be a good programmer. ;) You calculate the difference relative to the original amount. So you get: percentage = ((newPay - oldPay) / oldPay) * 100 To calculate the new amount from the percentage, you can just convert the formula: newPay = oldPay + (percentage / 100) * oldPay

        Despite everything, the person most likely to be fooling you next is yourself.

        1 Reply Last reply
        0
        • J Joey Picerno

          I am not very good with percentages in calculations. I am writing in VB(.net 2005). I have 3 textboxes. One is current pay, and one is new pay. Both DOUBLE values. I need to have a calculation that finds the percentage of the increase in pay after the current pay and new pay are entered in the textboxes. I also need a calculation that allows the user to enter the current pay and percentage(the 3rd textbox) of the increase and calculate the new pay. So there are actually two calculations. Please someone help me out with this. I know to someone who is good with calculations and percentages can figure this one out fairly quickly. Thank you!!!

          M Offline
          M Offline
          Manas Bhardwaj
          wrote on last edited by
          #4

          Wrong Forum...And In between, I don' t see any forum called Juniour School Problems at CP ;P

          Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

          1 Reply Last reply
          0
          • J Joey Picerno

            I am not very good with percentages in calculations. I am writing in VB(.net 2005). I have 3 textboxes. One is current pay, and one is new pay. Both DOUBLE values. I need to have a calculation that finds the percentage of the increase in pay after the current pay and new pay are entered in the textboxes. I also need a calculation that allows the user to enter the current pay and percentage(the 3rd textbox) of the increase and calculate the new pay. So there are actually two calculations. Please someone help me out with this. I know to someone who is good with calculations and percentages can figure this one out fairly quickly. Thank you!!!

            A Offline
            A Offline
            Ashfield
            wrote on last edited by
            #5

            What a ridiculous question to post in a progamming forum. If yuo don't know how to do calculations try Google, there are loads of pages devoted to all sorts of caluations from simple percentages to complex scientific formulae.

            Bob Ashfield Consultants Ltd

            J 1 Reply Last reply
            0
            • A Ashfield

              What a ridiculous question to post in a progamming forum. If yuo don't know how to do calculations try Google, there are loads of pages devoted to all sorts of caluations from simple percentages to complex scientific formulae.

              Bob Ashfield Consultants Ltd

              J Offline
              J Offline
              Joey Picerno
              wrote on last edited by
              #6

              Look, if you have a problem with my post, DONT READ IT. Ive gone through this before on code project. Someone remarked that my post was dumb and shouldnt be here. Guess what? I dont really care whether you approve of my post being here or not. I know that most programmers enjoy writing equations and calculations so I was helping to give a couple of programmers something fun to do. And I do know how to do calculations, Im just not good with percentages. If you dont have something to add to the question I asked, dont post a reply. You are wasting your time trying to criticize people's posts in a forum. It is childish and rude. Dont you have something better to do with your time? Like I said, if you dont like it, DONT READ IT!!!!! That goes for the other guy that criticized my post too, both of you. Grow up and get a life! On the upside though thank you for your suggestion on using Google. However I already tried searching the web to find a solution and had no luck. THATS WHY I CAME HERE...

              A 1 Reply Last reply
              0
              • J Joey Picerno

                Look, if you have a problem with my post, DONT READ IT. Ive gone through this before on code project. Someone remarked that my post was dumb and shouldnt be here. Guess what? I dont really care whether you approve of my post being here or not. I know that most programmers enjoy writing equations and calculations so I was helping to give a couple of programmers something fun to do. And I do know how to do calculations, Im just not good with percentages. If you dont have something to add to the question I asked, dont post a reply. You are wasting your time trying to criticize people's posts in a forum. It is childish and rude. Dont you have something better to do with your time? Like I said, if you dont like it, DONT READ IT!!!!! That goes for the other guy that criticized my post too, both of you. Grow up and get a life! On the upside though thank you for your suggestion on using Google. However I already tried searching the web to find a solution and had no luck. THATS WHY I CAME HERE...

                A Offline
                A Offline
                Ashfield
                wrote on last edited by
                #7

                Joey Picerno wrote:

                Look, if you have a problem with my post, DONT READ IT.

                How do I know if I can help if I don't read it? :confused:

                Joey Picerno wrote:

                I know that most programmers enjoy writing equations and calculations

                I know a lot of programmers enjoy cooking, but I wouldn't ask for a recipe in a programmng forum

                Joey Picerno wrote:

                However I already tried searching the web to find a solution and had no luck. THATS WHY I CAME HERE...

                Not very good at Google either then. The top entry of http://www.google.co.uk/search?hl=en&q=how+to+calculate+percentage&meta=[^] tells you in easy to understand terms. I, like most of the people who actually answer questions on CP and other forums, try and help those less experienced or who have real programming problems. To do this I have to read posts to see if I can help. There are more than enough questions posted where 2 minutes on Google would reveal the solution without people posting what, despite your claims, is nothing to do with programmng. Finally,

                Joey Picerno wrote:

                Ive gone through this before on code project. Someone remarked that my post was dumb and shouldnt be here

                Joey Picerno wrote:

                That goes for the other guy that criticized my post too

                Notice a trend here? and don't worry, I won't waste my time readng any more of your ramblings.

                Bob Ashfield Consultants Ltd

                J 1 Reply Last reply
                0
                • A Ashfield

                  Joey Picerno wrote:

                  Look, if you have a problem with my post, DONT READ IT.

                  How do I know if I can help if I don't read it? :confused:

                  Joey Picerno wrote:

                  I know that most programmers enjoy writing equations and calculations

                  I know a lot of programmers enjoy cooking, but I wouldn't ask for a recipe in a programmng forum

                  Joey Picerno wrote:

                  However I already tried searching the web to find a solution and had no luck. THATS WHY I CAME HERE...

                  Not very good at Google either then. The top entry of http://www.google.co.uk/search?hl=en&q=how+to+calculate+percentage&meta=[^] tells you in easy to understand terms. I, like most of the people who actually answer questions on CP and other forums, try and help those less experienced or who have real programming problems. To do this I have to read posts to see if I can help. There are more than enough questions posted where 2 minutes on Google would reveal the solution without people posting what, despite your claims, is nothing to do with programmng. Finally,

                  Joey Picerno wrote:

                  Ive gone through this before on code project. Someone remarked that my post was dumb and shouldnt be here

                  Joey Picerno wrote:

                  That goes for the other guy that criticized my post too

                  Notice a trend here? and don't worry, I won't waste my time readng any more of your ramblings.

                  Bob Ashfield Consultants Ltd

                  J Offline
                  J Offline
                  Joey Picerno
                  wrote on last edited by
                  #8

                  Ashfield wrote:

                  I know a lot of programmers enjoy cooking, but I wouldn't ask for a recipe in a programmng forum

                  Ashfield wrote:

                  despite your claims, is nothing to do with programmng

                  So your saying that programmers never use calculations and equations??? Also, if my question had nothing to do about programming how was user "Guffa" able to give me a correct response with an equation that could be utilized in VB??? You arent making any sense and again are being very childish. Just drop it and go do something that is actually productive.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups