From 30cd5462b4b361f0cdb393271cd0aa69895a25c3 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Mon, 24 Sep 2012 01:57:33 +0200 Subject: [PATCH] brmbar.Currency.str(): Properly format to two decimal places --- brmbar3/brmbar/Currency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brmbar3/brmbar/Currency.py b/brmbar3/brmbar/Currency.py index dcfd81a..c197bf1 100644 --- a/brmbar3/brmbar/Currency.py +++ b/brmbar3/brmbar/Currency.py @@ -75,4 +75,4 @@ class Currency: return resamount def str(self, amount): - return str(amount) + " " + self.name + return "{:.2f} {}".format(amount, self.name)