The scripting language that's supported in PDFs is JavaScript, which can be used to perform quite complex calculations. Here's a tutorial that should get you started: http://acrobatusers.com/tutorials/how-to-do-not-so-simple-form-calculations
Post again if you need help with a specific calculation, post again.