Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
20048 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ

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

Câu trả lời hay nhất

You should try following,

<span t-esc="my_count" t-options='{"widget": "float", "precision": 2}'/>
Ảnh đại diện
Huỷ bỏ

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.

Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 8 16
5503
1
thg 8 15
11990
2
thg 2 25
57967
1
thg 2 24
5774
1
thg 11 21
3955