WIP: improve rounding tool
Rounding Tool provides a way to round values with various rounding option but it does not provide a simple way to use it.
Also the current RoundingMovel.roundValue()
implementation is too slow because it defines round_method()
each time it is called.
(Pdb) timeit.timeit('round(12.344, 2)', number=100000)
0.07656502723693848
(Pdb) timeit.timeit('rounding_model.roundValue(12.344)', number=100000)
3.608372926712036
With this merge request, it becomes faster and it also provides a simple method (default ROUND_HALF_UP).
(Pdb) round_ = self.portal.portal_roundings.round
(Pdb) timeit.timeit('round_(123.45, 2)', number=100000)
1.530869960784912
(Pdb) timeit.timeit('rounding_model.roundValue(123.45)', number=100000)
2.805776834487915