When using relatorio outside of tryton, I want to locale-format Python Decimals. How can this be done?
Notes:
This stackoverflow answer shows a nice solution: {0:n}'.format(d) (after setting the locale, of course)
I tried to find how to use this in relatorio or genshi, but the genshi documentation does not actually explain how “variables” are resolved by the template engine. (At least I was not able to spot it).
You need to use the available tools of Python like locale.format ( setting locale is not threadsafe). Or you need to use third-party library like Babel.
With the keyword argument passed to the report instance as context.