[Solved]-Django FloatField in ModelForm with 2 precision point

21👍

I don’t know your use case, but using DecimalField will solve your issue

from the docs:
For example, to store numbers up to 999 with a resolution of 2 decimal places, you’d use:

models.DecimalField(..., max_digits=5, decimal_places=2)
👤Ashok

Leave a comment