wok annotate singularity/stuff/percents-0.30b.patch @ rev 7663
Up: freeciv to 2.2.4.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Thu Dec 16 09:03:01 2010 +0000 (2010-12-16) |
parents | |
children |
rev | line source |
---|---|
gokhlayeh@6960 | 1 --- singularity-0.30b/code/g.py |
gokhlayeh@6960 | 2 +++ singularity-0.30b/code/g.py |
gokhlayeh@6960 | 3 @@ -265,9 +265,9 @@ |
gokhlayeh@6960 | 4 def to_percent(raw_percent, show_full = False): |
gokhlayeh@6960 | 5 locale_name, encoding = locale.getlocale() |
gokhlayeh@6960 | 6 if raw_percent % 100 != 0 or show_full: |
gokhlayeh@6960 | 7 - return locale.format("%.2f%%", raw_percent / 100.).decode(encoding) |
gokhlayeh@6960 | 8 + return locale.format("%.2f", raw_percent / 100.).decode(encoding) |
gokhlayeh@6960 | 9 else: |
gokhlayeh@6960 | 10 - return locale.format("%d%%", raw_percent // 100).decode(encoding) |
gokhlayeh@6960 | 11 + return locale.format("%d", raw_percent // 100).decode(encoding) |
gokhlayeh@6960 | 12 |
gokhlayeh@6960 | 13 # nearest_percent takes values in the internal representation and modifies |
gokhlayeh@6960 | 14 # them so that they only represent the nearest percentage. |