Created
July 1, 2015 09:07
-
-
Save ljmccarthy/d75434090496be60552e to your computer and use it in GitHub Desktop.
This file contains 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
import sys | |
from decimal import Decimal, ROUND_UP | |
def ebay_postage_price(p): | |
d = p * (1 / (1 - Decimal('0.134'))) + Decimal('0.20') | |
return d.quantize(Decimal('0.1'), rounding=ROUND_UP) | |
for x in sys.argv[1:]: | |
print(format(ebay_postage_price(Decimal(x)), '.2f')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment