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

I am using Odoo 10 and I cant figure out how to stop a custom float field rounding.

Here is my field box = fields.Float("Yards Per Box")

In Odoo if I put 1.196 into the field it auto rounds to 1.20 how can I stop this on a custom Float field?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Use this one

box = fields.Float("Yards Per Box",digits=(12,3))

Hope this will helps you and others.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Thanks what does the (12,3)) stand for. If I have a float field that is 2.17 how do I get it to go to next number 3?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

thanks for the reply

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 9 23
9955
1
thg 2 22
6996
2
thg 7 19
3030
0
thg 11 18
2948
2
thg 1 18
7409