Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
15194 Näkymät

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

For example

<t t-set="price_unit" t-value="get_price_unit(l)"/>
<span t-esc="price_unit"/>

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



Avatar
Hylkää
Paras vastaus

I needed to show a thousand separator in a Qweb invoice field and I succeeded with the following  expression

<tr t-foreach="o.invoice_line" t-as="l">
...      <td><span t-esc="'{:,}'.format(l.price_subtotal)"/></td>
</tr>

 

Avatar
Hylkää
Paras vastaus

Hi,


Please check this,

<t t-esc="'{0:,.0f}'.format(price_unit)" />

Thanks
Aswini iWesabe
Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
7
elok. 19
24944
0
syysk. 18
4415
0
heinäk. 17
3861
0
maalisk. 17
4744
4
jouluk. 23
43421