SHARE
TWEET

Untitled

a guest Jun 26th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def api_wallet_translate_gold(value):
  2.     """Translate a value into string of money"""
  3.     if value >= 10000:  # Gold
  4.         return ("{0} gold, {1} silver and {2} copper."
  5.                 .format(str(value)[:-4], str(value)[-4:-2], str(value)[-2:]))
  6.     elif value >= 100:  # Silver
  7.         return ("{0} silver and {1} copper.".format(str(value)[-4:-2], str(value)[-2:]))
  8.     else:  # Copper
  9.         return ("{0} copper.".format(str(value)[-2:]))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top