Hi Community,
I have a field in python having the value of 16788.145 when i put this on report template it displays as 16788.15.How can i solve this issue.I need 16788.14 in the report
Thanks in advance
Hi Community,
I have a field in python having the value of 16788.145 when i put this on report template it displays as 16788.15.How can i solve this issue.I need 16788.14 in the report
Thanks in advance
Hi,
Try the following code
import math
custom_value = math.floor(16788.145 * 10 ** 2) / 10 ** 2
Regards
Hi,
In the report template, you can give it like this t-options='{"widget": "float", "decimal_precision": "Product Unit of Measure"}' along with t-esc or span.
Sample:
<t t-esc="l['quantity']" t-options='{"widget": "float", "decimal_precision": "Product Unit of Measure"}'/>
You can change the decimal_precision accordingly.
Thanks
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
0
Dec 18
|
3718 | |||
|
3
Feb 25
|
21941 | |||
|
1
Dec 22
|
5498 | |||
|
1
Oct 22
|
3682 | |||
|
1
Nov 18
|
4163 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
How to stop auto rounding of float fields in odoo: https://goo.gl/groZgT