django-import-export
django-import-export copied to clipboard
Decimal field gets overwritten by big decimal number

The number in the xlsx file is 1803,60
- What type is the underlying model field?
- Have you declared this field in your resource? If so, what widget type have you used (if any)?
- The value is definitely
1803,60? (I getdecimal.ConversionSyntaxwhen trying to import this value) - What version of django-import-export / django are you using?
If you could include steps to reproduce in the test app that would be very helpful.
I tried importing an XLSX field (Book "price" ) with a value of 1803.60 (I set the format to '0.00'). On, import the confirm screen implies that the trailing '0' will be lost on import which seems incorrect, because the value has not changed:

mode field: raw_requirement = models.DecimalField( verbose_name="Rohbedarf", max_digits=8, decimal_places=2, blank=True, null=True )
resource field: raw_requirement = fields.Field(column_name="Rohbedarf", attribute="raw_requirement")
actual value in xlsx file: 1803,60 (cell formated as number)
version of django / django-import-export: 4.0.2 / 2.8.0
Can you confirm that when it is imported to the db the value is correct? (you have decimal_places set to 2)?
Yes the value from the xlsx file gets saved correctly to the db. Apparently it is only wrong while importing.