Created
January 25, 2011 13:36
-
-
Save juliend2/794918 to your computer and use it in GitHub Desktop.
Quebec sales taxes
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
montant = ARGV[0].to_f | |
TPSpercent = 5 | |
TVQpercent = 8.5 | |
myTPS = montant * TPSpercent / 100 | |
myTVQ = (montant + myTPS) * TVQpercent / 100 | |
total = montant + myTPS + myTVQ | |
puts total.round(2) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(needs ruby 1.9.2)
run like this:
=> 407.28