Nonsensical attempt to avoid "funnily rounded" float numbers in RosettaStats.asPercentage()
Bug #720199 reported by
Abel Deuring
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Low
|
Abel Deuring |
Bug Description
It seems that the method RosettaStats.
>>> float(str(
3.2999999999999998
Values like 3.3 can never be precisely represented as a binary float value.
If we want a more readable display of such values, callsites should format the value like so:
'%1.2f' % 3.3
Or we let the method return strings directly.
Related branches
lp:~adeuring/launchpad/bug-688130
- Gavin Panella (community): Approve
-
Diff: 329 lines (+166/-14)5 files modifiedlib/lp/testing/factory.py (+18/-0)
lib/lp/translations/model/pofile.py (+12/-5)
lib/lp/translations/tests/test_pofile.py (+128/-0)
lib/lp/translations/tests/test_potmsgset.py (+7/-0)
lib/lp/translations/utilities/rosettastats.py (+1/-9)
tags: |
added: qa-untestable removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Fixed in stable r12469 <http:// bazaar. launchpad. net/~launchpad- pqm/launchpad/ stable/ revision/ 12469>.