Posted By

noah on 04/23/07


Tagged

simple money finance quick Calculator paycheck easy


Versions (?)

Calculate net paycheck


 / Published in: JavaScript
 

Given my base pay and an optional pre-tax 401k contribution percentage, calculate my net pay. Assumes US income tax of 27%. All results will be approximate (the browser is not a reliable calculator)!

  1. function paycheck (paid, retirementPercent) {
  2. var retireContrib = paid * retirementPercent * .01;
  3. paid = paid - retireContrib;
  4. var taxes = (paid * .27);
  5. var paycheck = paid - taxes; //taxes take 27 percent
  6. var totalOut = retireContrib + taxes;
  7. return retirementPercent+" 401k contribution:"+
  8. "\nNet Paycheck: ~$"+paycheck+
  9. "\n401k contrib: ~$"+retireContrib+
  10. "\ntaxes paid: ~$"+taxes+
  11. "\nTotal Out: ~$"+totalOut;
  12. }
  13. //8% retirement contribution from a $1234 paycheck:
  14. paycheck (1234, 8);

Report this snippet  

You need to login to post a comment.