VB.NET - % button on calculator - Asked By jenn on 11-Jun-10 04:36 PM

good afternoon guys :)

My newest adventure is making a calculator. LOL (trying to keep it simple so I can catch on a bit)

anyway, I have all of the buttons and things finished :)

there is just one button that is giving me such grief!! it is the percentage button! and, after looking arond for a few days..it seems this seems to be a nemisis for alot of people.

can someone help me out with this?

I dont really see a need to post my code for this calculator so far as i am sure most of ya already know such repetitve code but if needed I will be happy to do so :)

thanxxxX for any help anyone can give for me
Scott Gall replied to jenn on 11-Jun-10 09:47 PM
Basically you want to hard code it to move the decimal place 2 to the left. (or divide by 100 in place)

depends on the structure of your application how exactly to execute this.

The trick is that the % button skips order of operations and just operates on the last number entered/resulted.

If you need more detail than this I'd need an example to go with.

Hope this helps.