diff --git a/functions/src/on-update-contract.ts b/functions/src/on-update-contract.ts index f47c019c..4674bd82 100644 --- a/functions/src/on-update-contract.ts +++ b/functions/src/on-update-contract.ts @@ -24,6 +24,9 @@ export const onUpdateContract = functions.firestore if (resolutionText === 'MKT' && contract.resolutionProbability) resolutionText = `${contract.resolutionProbability}%` else if (resolutionText === 'MKT') resolutionText = 'PROB' + } else if (contract.outcomeType === 'PSEUDO_NUMERIC') { + if (resolutionText === 'MKT' && contract.resolutionValue) + resolutionText = `${contract.resolutionValue}` } await createNotification( diff --git a/web/components/outcome-label.tsx b/web/components/outcome-label.tsx index a94618e4..9ecda16f 100644 --- a/web/components/outcome-label.tsx +++ b/web/components/outcome-label.tsx @@ -9,7 +9,7 @@ import { FreeResponseContract, resolution, } from 'common/contract' -import { formatPercent } from 'common/util/format' +import { formatLargeNumber, formatPercent } from 'common/util/format' import { ClientRender } from './client-render' export function OutcomeLabel(props: { @@ -140,6 +140,11 @@ export function ProbPercentLabel(props: { prob: number }) { return {formatPercent(prob)} } +export function NumericValueLabel(props: { value: number }) { + const { value } = props + return {formatLargeNumber(value)} +} + export function AnswerNumberLabel(props: { number: string }) { return #{props.number} } diff --git a/web/pages/notifications.tsx b/web/pages/notifications.tsx index 39cc2017..aeeb9af0 100644 --- a/web/pages/notifications.tsx +++ b/web/pages/notifications.tsx @@ -21,7 +21,9 @@ import { BinaryOutcomeLabel, CancelLabel, MultiLabel, + NumericValueLabel, ProbPercentLabel, + PseudoNumericOutcomeLabel, } from 'web/components/outcome-label' import { NotificationGroup, @@ -828,6 +830,9 @@ function NotificationTextLabel(props: { ) if (sourceText === 'CANCEL') return if (sourceText === 'MKT' || sourceText === 'PROB') return + if (contract?.outcomeType === 'PSEUDO_NUMERIC') { + return + } } } // Close date will be a number - it looks better without it