nit with how we convert percent to negative value

This commit is contained in:
Moody Salem 2021-05-12 17:13:40 -05:00
parent 0e9f23ed56
commit 8964cf86aa
No known key found for this signature in database
GPG Key ID: 8CB5CD10385138DB

@ -9,7 +9,7 @@ import { ErrorText, ErrorPill } from './styleds'
export default function FormattedPriceImpact({ priceImpact }: { priceImpact?: Percent }) { export default function FormattedPriceImpact({ priceImpact }: { priceImpact?: Percent }) {
return ( return (
<ErrorText fontWeight={500} fontSize={12} severity={warningSeverity(priceImpact)}> <ErrorText fontWeight={500} fontSize={12} severity={warningSeverity(priceImpact)}>
{priceImpact ? `-${priceImpact.toFixed(2)}%` : '-'} {priceImpact ? `${priceImpact.multiply(-1).toFixed(2)}%` : '-'}
</ErrorText> </ErrorText>
) )
} }
@ -17,7 +17,7 @@ export default function FormattedPriceImpact({ priceImpact }: { priceImpact?: Pe
export function SmallFormattedPriceImpact({ priceImpact }: { priceImpact?: Percent }) { export function SmallFormattedPriceImpact({ priceImpact }: { priceImpact?: Percent }) {
return ( return (
<ErrorPill fontWeight={500} fontSize={12} severity={warningSeverity(priceImpact)}> <ErrorPill fontWeight={500} fontSize={12} severity={warningSeverity(priceImpact)}>
{priceImpact ? `(-${priceImpact.toFixed(2)}%)` : '-'} {priceImpact ? `(${priceImpact.multiply(-1).toFixed(2)}%)` : '-'}
</ErrorPill> </ErrorPill>
) )
} }