aboutsummaryrefslogtreecommitdiff
path: root/modules/coins.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-31 16:46:40 +0000
committerGravatar jesopo2018-10-31 16:46:40 +0000
commit60151dc1a0d6e2c4186510ad672cc79bf62b5223 (patch)
tree2f52ba5971a13a05e0f389733317a5aae07c98f8 /modules/coins.py
parentAdd '.mypy_cache/' to .gitignore (diff)
signature
Comma-delimit numbers in the !richest response
Diffstat (limited to 'modules/coins.py')
-rw-r--r--modules/coins.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/coins.py b/modules/coins.py
index 9b05ea74..eaca4b32 100644
--- a/modules/coins.py
+++ b/modules/coins.py
@@ -131,6 +131,8 @@ class Module(ModuleManager.BaseModule):
def _coin_str(self, coins):
return "{0:.2f}".format(coins)
+ def _coin_str_human(self, coins):
+ return "{0:,.2f}".format(coins)
def _parse_coins(self, s, minimum=None):
try:
s = utils.parse_number(s)
@@ -336,7 +338,7 @@ class Module(ModuleManager.BaseModule):
top_10 = utils.top_10(self._all_coins(event["server"]),
convert_key=lambda nickname: utils.prevent_highlight(
event["server"].get_user(nickname).nickname),
- value_format=lambda value: self._coin_str(value))
+ value_format=lambda value: self._coin_str_human(value))
event["stdout"].write("Richest users: %s" % ", ".join(top_10))
def _redeem_cache(self, server, user):