diff --git a/tradein-mvp/frontend/src/components/trade-in/DealsCard.tsx b/tradein-mvp/frontend/src/components/trade-in/DealsCard.tsx index 846ecea2..3e83312e 100644 --- a/tradein-mvp/frontend/src/components/trade-in/DealsCard.tsx +++ b/tradein-mvp/frontend/src/components/trade-in/DealsCard.tsx @@ -86,8 +86,11 @@ export function DealsCard({ estimate }: Props) { млн ₽
- на {(((estimate.median_price_rub - m) / estimate.median_price_rub) * 100).toFixed(0)}% - ниже рынка + {estimate.median_price_rub > 0 + ? `на ${Math.abs(((estimate.median_price_rub - m) / estimate.median_price_rub) * 100).toFixed(0)}% ${ + estimate.median_price_rub - m >= 0 ? "ниже" : "выше" + } рынка` + : "—"}
diff --git a/tradein-mvp/frontend/src/components/trade-in/ListingsCard.tsx b/tradein-mvp/frontend/src/components/trade-in/ListingsCard.tsx index 8a9e1123..8820700e 100644 --- a/tradein-mvp/frontend/src/components/trade-in/ListingsCard.tsx +++ b/tradein-mvp/frontend/src/components/trade-in/ListingsCard.tsx @@ -150,7 +150,12 @@ export function ListingsCard({ estimate, estimateId }: Props) { млн
-
CV {(((estimate.range_high_rub - estimate.range_low_rub) / m) * 100).toFixed(1)}%
+
+ CV{" "} + {m > 0 + ? `${(((estimate.range_high_rub - estimate.range_low_rub) / m) * 100).toFixed(1)}%` + : "—"} +