Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] web: remove human_number limitations
The formatting of very big numbers (like 1.0045e+22) was not handled adequately by the function 'human_number' in web.utils. For those numbers, it seems more appropriate to use the scientific format. The only difference introduced here is the following. Beyond a magnitude of e+21, we represent the numbers by themselves but we keep the number of decimals provided as parameter (or zero by default) and we remove useless zero decimals like in the other cases. For instance, 1.0045e+22 is replaced by 1e+22 instead of 1.00e+22 if ask 2 decimals of precision (and by 1.005e+22 for 3 decimals). We have also fixed a small bug occuring in the previous version of the function: the symbol 'E' was never used. So by the past the above number would have be represented as 10045000P and, even worse, 1.01e+45 by 1.012e+28P. closes #31140
- Loading branch information