From: Vincent Le Gallic Date: Fri, 31 Jan 2014 15:25:38 +0000 (+0100) Subject: [bde/virements] égalité de flottant : you're screwed X-Git-Url: http://gitweb.pimeys.fr/?p=scripts-20-100.git;a=commitdiff_plain;h=14588d148b4c6ae09ef6b84ae90364244575105a [bde/virements] égalité de flottant : you're screwed --- diff --git a/bde/virements.py b/bde/virements.py index f14f08b..030fca6 100755 --- a/bde/virements.py +++ b/bde/virements.py @@ -129,7 +129,7 @@ def virements(): print "Total : %s" % total print "\nPayeurs :\n" + " ".join(["%s (%s)" % (i[1]["pseudo"], i[0]) for i in destinataires]) print "Total : %s" % total_pay + "\n" - if total != total_pay: + if abs(total-total_pay) >= 0.01: print "Les totaux des participations et des paiements ne concordent pas !\nAbort." exit(1)