diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2017-10-25 13:21:07 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2017-10-25 13:21:07 +0200 |
| commit | c6dc8f6727dba0e3f93773d1d1854c8d212187ad (patch) | |
| tree | 943dab621d058b78dcc86ff839eb064d5b1c5291 | |
| parent | 62722a8826690de434fc248f925cf1e691864066 (diff) | |
| download | geldschieberbot-c6dc8f6727dba0e3f93773d1d1854c8d212187ad.tar.gz geldschieberbot-c6dc8f6727dba0e3f93773d1d1854c8d212187ad.zip | |
remove round and use string.format
| -rw-r--r-- | geldschieberbot.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/geldschieberbot.py b/geldschieberbot.py index f3412c6..b1ee187 100644 --- a/geldschieberbot.py +++ b/geldschieberbot.py @@ -27,12 +27,11 @@ def create_summary(user): if amount == 0: continue total -= amount - summary += "\t" + ("<-" if amount < 0 else "->") - summary += " " + person + " " + str(abs(amount).round(2)) + "\n" + summary += "\t{} {} {:g}\n".format("<-" if amount < 0 else "->", person, abs(amount)) if summary == "": summary = "\tAll fine :)\n" else: - summary += "\tBalance: " + str(total.round(2)) + summary += "\tBalance: {:g}".format(total) summary = user + ":\n" + summary return summary |
