def METHOD_NAME(self, value):
    # Used to check the number types for hold and available.
    if self.asset.asset_type != "crypto":
        return 0
    default_precision = 8
    precision = (
        self.asset.precision
        if hasattr(self, "asset.precision")
        else default_precision
    )
    if isinstance(value, Decimal):
        return value.quantize(Decimal(precision))
    elif isinstance(
        value,
        (
            int,
            float,
            str,
        ),
    ):
        return Decimal(str(value)).quantize(Decimal(precision))