Skip to content

Instantly share code, notes, and snippets.

@juliend2
Created January 25, 2011 13:36
Show Gist options
  • Save juliend2/794918 to your computer and use it in GitHub Desktop.
Save juliend2/794918 to your computer and use it in GitHub Desktop.
Quebec sales taxes
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)
@juliend2
Copy link
Author

(needs ruby 1.9.2)

run like this:

  ruby taxes.rb 357.50

=> 407.28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment