440,782 Members | 1,154 Online Need help? Post your question and get tips & solutions from a community of 440,782 IT Pros & Developers. It's quick & easy.

# Calculate Tax

 P: 10 does anyone know where there is an example of how to write code for tax added on to the subtotal to equal price? I looked in the tutorials but didnt see anything like it, and I dont just want people to do my work for me because I want to learn how to write code myself. I am a beginner just to let you know Dec 22 '06 #1
6 Replies

 Expert 2.5K+ P: 3,652 If you have the tax rate (a.k.a. 5%) and the subtotal (e.g. \$10.00), you can multiply the subtotal by the percentage to determine the amount of tax to add - then add that amount to the subtotal to find the total. The tax rate will either be held as a decimal (a.k.a. 5% would be 0.05) or as an integer (a.k.a. 5% would be 5), and your calculations will have to differ accordingly - if you hold it as a decimal, you can multiply straight away, but if you hold it as an integer, you will have to divide by 100.0 before multiplying. Dec 22 '06 #2 