跳至內容
選單
此問題已被標幟
1 回覆
3930 瀏覽次數

Hello, 


I must handle numbers with high decimal precision due to the type of data I am measuring.


When doing the exercise of saving the number 744123812.85936641353 it shows me 744,123,812.85936677456 and 744123812.85936653614 is stored in the data bd. I don't understand what I'm doing wrong.


Could you give me a hand?

num= fields.Float('Number', digits=(21,11))
頭像
捨棄
最佳答案

Hi Gustavo:

This is a standard issue with floating point arithmetic in python. Here's a link to a description of the issue and how to code to handle it.

https://docs.python.org/3/tutorial/floatingpoint.html?highlight=float precision

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
11月 23
1140
0
6月 23
2320
0
10月 22
2197
0
10月 22
2307
2
10月 21
4612