Round prob in Daily movers
This commit is contained in:
parent
8f30ef38d9
commit
e7ed893b78
|
@ -756,9 +756,10 @@ function SellButton(props: {
|
||||||
|
|
||||||
export function ProfitBadge(props: {
|
export function ProfitBadge(props: {
|
||||||
profitPercent: number
|
profitPercent: number
|
||||||
|
round?: boolean
|
||||||
className?: string
|
className?: string
|
||||||
}) {
|
}) {
|
||||||
const { profitPercent, className } = props
|
const { profitPercent, round, className } = props
|
||||||
if (!profitPercent) return null
|
if (!profitPercent) return null
|
||||||
const colors =
|
const colors =
|
||||||
profitPercent > 0
|
profitPercent > 0
|
||||||
|
@ -773,7 +774,9 @@ export function ProfitBadge(props: {
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{(profitPercent > 0 ? '+' : '') + profitPercent.toFixed(1) + '%'}
|
{(profitPercent > 0 ? '+' : '') +
|
||||||
|
profitPercent.toFixed(round ? 0 : 1) +
|
||||||
|
'%'}
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,10 +77,10 @@ export function ProbChange(props: {
|
||||||
} = contract
|
} = contract
|
||||||
return (
|
return (
|
||||||
<Col className={clsx('flex flex-col items-end', className)}>
|
<Col className={clsx('flex flex-col items-end', className)}>
|
||||||
<span className="mr-1.5 mb-0.5 text-2xl">
|
<span className="mb-0.5 mr-0.5 text-2xl">
|
||||||
{formatPercent(Math.round(100 * prob) / 100)}
|
{formatPercent(Math.round(100 * prob) / 100)}
|
||||||
</span>
|
</span>
|
||||||
<ProfitBadge className="ml-0" profitPercent={100 * change} />
|
<ProfitBadge className="ml-0" profitPercent={100 * change} round />
|
||||||
</Col>
|
</Col>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user