我正在尝试向数据库中插入数据,但似乎存在小数问题。
我有latitude
和longitude
,例如以下示例:
latitude = models.DecimalField(max_digits=30, decimal_places=15)
然后,当我尝试插入数据时,我会写:
Place(name="center", description="study center", latitude=41.214555, longitude=2.121451)
但是我遇到了这个错误:"quantize result has too many digits for current context"
我应该可以使用这些数字,对吗?我不明白为什么会出现这个错误。如果有人能帮助我,我将非常感激。