Formatting converted the decimal part into an integer, dropping all
leading 0s and failing to reinsert them.
The conversion also lead to compounded errors, casting 0.1100 into
0.10999 (something like that).
Replace this by a straight float formatting via _.sprintf and the
slicing of the decimal part from the resulting string (Math.abs and %1
clamp the value to format to the [0, 1[ range, ensuring we just need
to slice off the first two characters). Also add some tests.
lp bug: https://launchpad.net/bugs/879355 fixed
bzr revid: xmo@openerp.com-20111021120741-813im5bzup7vho1f