3
I have the following class:
class Carro(models.Model):
valor = models.DecimalField(max_digits=8, decimal_places=2, default=0)
And its respective form:
class CarroForm(forms.ModelForm):
class Meta():
model = Carro
fields = ['valor']
When printing the form in the template one appears input of the kind number:
<input id="id_valor" name="valor" step="0.01" type="number" value="0">
The question is how to allow this field to accept point and comma values? Currently only accepting decimal separation (ex: 1253.00), I would like you to accept separation from thousands using point (ex: 1.253,00). What is the correct solution for this case? The idea is in the input the value come in currency format (1.253,00) and in the bank store as normal decimal (1253.00).