Last active
August 29, 2015 14:24
-
-
Save rumblestrut/83b3d05a22ac72eba73c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const OLD_TAX_RATE = 0.061; | |
| const NEW_TAX_RATE = 0.065; | |
| function calculateOldPurchase(amt) { | |
| amt = amt + (amt * OLD_TAX_RATE); | |
| return amt; | |
| } | |
| function calculateNewPurchase(amt) { | |
| amt = amt + (amt * NEW_TAX_RATE); | |
| return amt; | |
| } | |
| price = 150.00; | |
| old_total = calculateOldPurchase(price); | |
| new_total = calculateNewPurchase(price); | |
| console.log("Based on a $150 purchase, your previous total under the state sales tax rate of 6.1 percent would be " + "$" + old_total.toFixed(2) + ", but now costs you " + "$" + new_total.toFixed(2) + " at 6.5 percent."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment