# pydantic.errors.DecimalError: value is not a valid decimal

- **ID:** `python/pydantic-decimal-precision-loss`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

When using Decimal type, input is a float or string that cannot be precisely converted to Decimal, causing precision loss or invalid format.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 2.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Pass string representation: Decimal('123.45')
   ```
2. **** (85% success)
   ```
   Use condecimal with proper constraints: price: condecimal(max_digits=10, decimal_places=2)
   ```

## Dead Ends

- **** — Float has binary representation issues; Pydantic may raise DecimalError or lose precision. (80% fail)
- **** — If max_digits or decimal_places constraints are set, it fails. (70% fail)
