diff --git a/web/components/contract/contract-card.tsx b/web/components/contract/contract-card.tsx index 80c90b93..66d56ee8 100644 --- a/web/components/contract/contract-card.tsx +++ b/web/components/contract/contract-card.tsx @@ -1,11 +1,7 @@ import clsx from 'clsx' import Link from 'next/link' import { Row } from '../layout/row' -import { - formatLargeNumber, - formatMoney, - formatPercent, -} from 'common/util/format' +import { formatLargeNumber, formatPercent } from 'common/util/format' import { contractPath, getBinaryProbPercent } from 'web/lib/firebase/contracts' import { Col } from '../layout/col' import { @@ -42,6 +38,7 @@ import { SiteLink } from '../site-link' import { ProbChange } from './prob-change-table' import { Card } from '../card' import { ProfitBadgeMana } from '../profit-badge' +import { floatingEqual } from 'common/util/math' export function ContractCard(props: { contract: Contract @@ -405,7 +402,7 @@ export function ContractCardProbChange(props: { const metrics = useUserContractMetrics(user?.id, contract.id) const dayMetrics = metrics && metrics.from && metrics.from.day const outcome = - metrics && metrics.hasShares && metrics.totalShares.YES ? 'YES' : 'NO' + metrics && floatingEqual(metrics.totalShares.NO ?? 0, 0) ? 'YES' : 'NO' return ( @@ -423,7 +420,7 @@ export function ContractCardProbChange(props: { - {showPosition && metrics && ( + {showPosition && metrics && metrics.hasShares && (
Position
- {formatMoney(metrics.payout)} {outcome} + {Math.floor(metrics.totalShares[outcome])} {outcome}
{dayMetrics && (