Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
19944 Visualizzazioni

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.

Avatar
Abbandona

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

Risposta migliore

You should try following,

<span t-esc="my_count" t-options='{"widget": "float", "precision": 2}'/>
Avatar
Abbandona

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.

Autore Risposta migliore

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

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
ago 16
5453
1
ago 15
11950
2
feb 25
57869
1
feb 24
5711
1
nov 21
3898