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: {
|
||||
profitPercent: number
|
||||
round?: boolean
|
||||
className?: string
|
||||
}) {
|
||||
const { profitPercent, className } = props
|
||||
const { profitPercent, round, className } = props
|
||||
if (!profitPercent) return null
|
||||
const colors =
|
||||
profitPercent > 0
|
||||
|
@ -773,7 +774,9 @@ export function ProfitBadge(props: {
|
|||
className
|
||||
)}
|
||||
>
|
||||
{(profitPercent > 0 ? '+' : '') + profitPercent.toFixed(1) + '%'}
|
||||
{(profitPercent > 0 ? '+' : '') +
|
||||
profitPercent.toFixed(round ? 0 : 1) +
|
||||
'%'}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -77,10 +77,10 @@ export function ProbChange(props: {
|
|||
} = contract
|
||||
return (
|
||||
<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)}
|
||||
</span>
|
||||
<ProfitBadge className="ml-0" profitPercent={100 * change} />
|
||||
<ProfitBadge className="ml-0" profitPercent={100 * change} round />
|
||||
</Col>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user