def get_clean_quantity_value(self, quantity=1, allow_zero=False):
        try:
            quantity = abs(core_utils.atof(str(quantity)))
        except (TypeError, ValueError):
            quantity = 1.0

        if not allow_zero:
            quantity = 1 if quantity <= 0 else quantity

        type_of_quantity_field = self.get_type_of_quantity_field()
        if type_of_quantity_field == QUANTITY_FIELD_INTEGER or getattr(settings, 'LFS_FORCE_INTEGER_QUANTITY', False):
            quantity = int(quantity)

        return quantity
Returns the valid quantity based on the product's type of
dataset/ETHPy150Open diefenbach/django-lfs/lfs/catalog/models.py/Product.get_clean_quantity_value