Format float and computed Decimal using fixed-point notation

This avoid the usage of scientific notation.
For float we must convert them to Decimal to get a precision large enough to
show all coefficient digits.
For computed Decimal (which are thus not rounded) we must normalized them first
to avoid trailing 0.

Closes #14522
This commit is contained in:
Cédric Krier committed 2026-01-20 09:19:12 +01:00
1 parent 8ae58308ce
commit 680344c92b
5 files changed
+18 -12

No files matched your search

+4 -1
View File
@@ -86,7 +86,10 @@ class Invoice(Model):
tmpl = self._get_template(template)
if not tmpl:
raise NotImplementedError
return (tmpl.generate(this=self, specification=specification)
return (tmpl.generate(
this=self,
specification=specification,
Decimal=Decimal)
.filter(remove_comment)
.render()
.encode('utf-8'))