From 5076791b641fced9605fb52fd5ce56aacda40f89 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Fri, 14 Jun 2013 03:16:17 +0200 Subject: [PATCH] solde en centimes --- basile.py | 2 +- nk.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/basile.py b/basile.py index b467ac8..f3c193c 100755 --- a/basile.py +++ b/basile.py @@ -559,7 +559,7 @@ class Basile(ircbot.SingleServerIRCBot): if self.identities.has_key(auteur): success, solde, pseudo = nk.get_solde(self.nk, self.identities[auteur]["idbde"], serv, auteur) if success: - serv.privmsg(auteur, "%s (%s)" % (float(solde)/100, pseudo.encode("utf8"))) + serv.privmsg(auteur, "%.2f (%s)" % (solde/100.0, pseudo.encode("utf8"))) log(self.serveur, "priv", auteur, " ".join(message) + ("[successful]" if success else "[failed]")) else: serv.privmsg(canal, "Je ne connais pas ton pseudo note.") diff --git a/nk.py b/nk.py index 6de4691..f7f4bb3 100644 --- a/nk.py +++ b/nk.py @@ -126,7 +126,7 @@ def consomme(sock, idbde, conso, serv, canal): else: success, solde, pseudo = get_solde(sock, idbde, serv, canal) if success: - serv.privmsg(canal, (u"%s consomme 1 %s (nouveau solde : %s)" % (pseudo, bouton["label"], solde)).encode("utf-8")) + serv.privmsg(canal, (u"%s consomme 1 %s (nouveau solde : %.2f)" % (pseudo, bouton["label"], solde/100.0)).encode("utf-8")) else: serv.privmsg(canal, (u"%s consommé mais impossible de récupérer le solde après transaction." % (bouton["label"])).encode("utf-8")) return True # on a réussi à consommer la conso -- 2.39.2