Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
6251 มุมมอง

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


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง