现在,当我保存一个金额如5400.5789时,它被保存为5400.58。但是,我希望它只保存为5400.57。我不想舍入小数位。我如何才能实现这一点?
class PerTransaction(models.Model):
amount = models.DecimalField(default=0, max_digits=10,decimal_places=2, verbose_name = "Transaction Amount")
字符串
数据库:PostgreSQL
现在,当我保存一个金额如5400.5789时,它被保存为5400.58。但是,我希望它只保存为5400.57。我不想舍入小数位。我如何才能实现这一点?
class PerTransaction(models.Model):
amount = models.DecimalField(default=0, max_digits=10,decimal_places=2, verbose_name = "Transaction Amount")
字符串
数据库:PostgreSQL
1条答案
按热度按时间nwsw7zdq1#
字符串