Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
6191 Visualizações

Hello Everyone

I have some calculated value and I want to display it on report.

For example

<t t-set="price_unit" t-value="2000000"/>
<span t-esc="price_unit"/>

And it should be 2.000.000

The only thing I could use in the previous versions was formatLang, but that is a webkit method and Odoo 12 doesn't have that anymore. Is there any other way to format the number and it's thousands separator in qweb?

Help me, pls
Thanks


Avatar
Cancelar
Melhor resposta

Hello

try with below options.

<span t-esc="price_unit" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>

you have to pass the currency so it will get the separator automatically.

I hope this will helps you.

Avatar
Cancelar
Melhor resposta

and what if we do not want a currency symbol with it. Is there any solution for that thanks in advance

Avatar
Cancelar