From ecc87c7989c42be05fb9ebbe003ad61fc7e44a11 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Tue, 15 Mar 2022 21:46:07 -0500 Subject: [PATCH] Correctly render resolve prob % --- web/components/contract-card.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/components/contract-card.tsx b/web/components/contract-card.tsx index 1e36fb6b..2b92b84a 100644 --- a/web/components/contract-card.tsx +++ b/web/components/contract-card.tsx @@ -3,7 +3,7 @@ import Link from 'next/link' import { ClockIcon, DatabaseIcon, PencilIcon } from '@heroicons/react/outline' import { TrendingUpIcon } from '@heroicons/react/solid' import { Row } from '../components/layout/row' -import { formatMoney } from '../../common/util/format' +import { formatMoney, formatPercent } from '../../common/util/format' import { UserLink } from './user-page' import { Contract, @@ -20,6 +20,7 @@ import { Avatar } from './avatar' import { Spacer } from './layout/spacer' import { useState } from 'react' import { TweetButton } from './tweet-button' +import { getProbability } from '../../common/calculate' export function ContractCard(props: { contract: Contract @@ -88,7 +89,11 @@ export function ResolutionOrChance(props: { { YES: 'YES', NO: 'NO', - MKT: isBinary ? getBinaryProbPercent(contract) : 'MULTI', + MKT: isBinary + ? formatPercent( + contract.resolutionProbability ?? getProbability(contract) + ) + : 'MULTI', CANCEL: 'N/A', '': '', }[resolution || ''] ?? `#${resolution}`