dota2win: allow formatting of win percentage by passing it as float, not preformatted string

See example format on how to do that.
This commit is contained in:
Paul Bienkowski 2015-07-21 17:42:22 +02:00
parent e85425c8c6
commit bea95ab5e4

View File

@ -38,7 +38,7 @@ class Dota2wins(IntervalModule):
matches = 25
interval = 1800
screenname = 'retrieve'
format = "{screenname} {wins}W:{losses}L {win_percent}%"
format = "{screenname} {wins}W:{losses}L {win_percent:.2f}%"
def run(self):
api.set_api_key(self.steam_api_key)
@ -96,7 +96,7 @@ class Dota2wins(IntervalModule):
"screenname": screenname,
"wins": wins,
"losses": losses,
"win_percent": "%.2f" % win_percent,
"win_percent": win_percent,
}
self.output = {