added one decimal place to format_binomial_conf output
authorForrest Voight <forrest@forre.st>
Sat, 4 Feb 2012 05:39:00 +0000 (00:39 -0500)
committerForrest Voight <forrest@forre.st>
Sat, 4 Feb 2012 06:06:47 +0000 (01:06 -0500)
p2pool/util/math.py

index b9d83d2..a332478 100644 (file)
@@ -152,7 +152,7 @@ def format_binomial_conf(x, n, conf=0.95, f=lambda x: x):
     if n == 0:
         return '???'
     left, right = minmax(map(f, binomial_conf_interval(x, n, conf)))
-    return '~%i%% (%i-%i%%)' % (int(100*f(x/n)+1/2), int(100*left), 100-int(100-100*right))
+    return '~%.1f%% (%i-%i%%)' % (f(x/n), int(100*left), 100-int(100-100*right))
 
 def reversed(x):
     try: