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

Hello, I'm using Odoo11, and need to format a qweb variable in a qweb report (report_saleorder_document).

The variable is a float number and should have the correct Thousands- and Decimal-Separator for the users language.


Example:

<t t-set="my_count" t-value="20000.1938"/>

<span t-esc="my_count"/>


In the report this shows: 20000.1938

but in the users language it should be: 20.000,1938


The Separators are correct set in odoo and work for other variables like product price.

อวตาร
ละทิ้ง

Did you check a default report or view for reference how it is done?

คำตอบที่ดีที่สุด

You should try following,

<span t-esc="my_count" t-options='{"widget": "float", "precision": 2}'/>
อวตาร
ละทิ้ง

any other way ?

+1 for your answers. Thanks a lot it help me in display values like 111,22.00.

+1 from me.

It's working well.

ผู้เขียน คำตอบที่ดีที่สุด

 Thanks for your answer. Is there a way to use the widget without a precision? I need to give out numbers with different precision?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ส.ค. 16
5569
1
ส.ค. 15
12048
2
ก.พ. 25
58123
1
ก.พ. 24
5863
1
พ.ย. 21
4041