-
- Downloads
[FIX] web: human numbers and percentages
A recent modification of the float and integer formatters allowing the rendering to be human readable causes a bug in the percentage formatter for large values. The reason is that the latter formatter uses formatFloat (wich can now produce 'numbers' like 3k) and then parse the result. In the case of 3k an error is raised since 3k is not recognized as a true number. This fixes avoid to parse the number in case it has been formatted to be 'readable'. Note that the parsing was essentially used to produces better percentages like 10% instead of 10.00%. This is not necessary in our case since utils.human_number takes care of the unwanted (not all) decimals for us (the original number is always rounded by utils.human_number).
Please register or sign in to comment