I'm following the documentation about serializers in this link, I'm not sure if there's lack of documentation regarding on decimal serializers ?. I defined an Item with a scrapy field like this:
prize = scrapy.Field(serializer=Decimal, output_processor=TakeFirst())
I'm getting several errors when scrapinhub stores this value, especially with numbers containing commas.
Is there any standard method for serializing decimals?
This is not a
scrapinghub
, orscrapy
error, you cannot convert a strings with comma into a number, you'll first have to remove that comma and then convert: