Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def api_wallet_translate_gold(value):
- """Translate a value into string of money"""
- if value >= 10000: # Gold
- return ("{0} gold, {1} silver and {2} copper."
- .format(str(value)[:-4], str(value)[-4:-2], str(value)[-2:]))
- elif value >= 100: # Silver
- return ("{0} silver and {1} copper.".format(str(value)[-4:-2], str(value)[-2:]))
- else: # Copper
- return ("{0} copper.".format(str(value)[-2:]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement