Rus*_*sty 3 python django django-templates django-models
我有一个模型DecimalField:
points_player1 = models.DecimalField(max_digits=3, decimal_places=1, blank=True, null=True)
Run Code Online (Sandbox Code Playgroud)
当我在模板中显示此字段时,它始终显示类似0.0或1.0等的值.但我想使此行为更加用户友好:
1它显示1(现在它的1.0).1.5,则应显示1.5.0,而不是0.0.最好的方法是什么?是DecimalField对我的情况下,正确的选择?
| 归档时间: |
|
| 查看次数: |
9751 次 |
| 最近记录: |