Better localization support for decimal separator.

svn: r11999
This commit is contained in:
Luigi Toscano
2009-02-15 21:50:27 +00:00
parent 00a667a54e
commit ce8b02c9f6
3 changed files with 9 additions and 8 deletions

View File

@@ -32,6 +32,7 @@
#------------------------------------------------------------------------
from gettext import gettext as _
from gettext import ngettext
import locale
import math
#------------------------------------------------------------------------
@@ -95,7 +96,7 @@ class NumberOfAncestorsReport(Report):
gen += 1
theoretical = math.pow(2, ( gen - 1 ) )
total_theoretical += theoretical
percent = '(%3.2f%%)' % ((sum(thisgen.values()) / theoretical ) * 100)
percent = '(%s%%)' % locale.format('%3.2f', ((sum(thisgen.values()) / theoretical ) * 100))
# TC # English return something like:
# Generation 3 has 2 individuals. (50.00%)