Best way to render numeric values in ods?
Created originally on Bitbucket by Anonymous
Hi!
i'm wondering what is the best way to render numeric values in a portable way in ods templates.
The example has =NUMBERVALUE(${item.value}, ".", "").
This results in =NUMBERVALUE(VALUE("5.1"), ".", "").
This nesting of VALUE() in NUMBERVALUE() does not make sense to me, and is not portable as VALUE("5.1") fails on machines where the decimal separator is not a dot.
=NUMBERVALUE(${str(item.value)}, ".", "") results in =NUMBERVALUE("5.1", ".", "") which is correct but not intuitive for template authors.
I see in the code that ${item.value} is replaced by ${getattr(item.value, "odf_value", ""5.1""). But I don't understand in which circumstances the odf_value attribute can be set (I'm using Odoo report_py3o).
Perhaps I'm overlooking something? Any hint much appreciated!