Skip to content

Commit

Permalink
Ensure negative sign is left of the dollar sign
Browse files Browse the repository at this point in the history
  • Loading branch information
sealer3 committed Apr 25, 2024
1 parent 6459937 commit 043b155
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/FiatValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ const FiatValue: FC<FiatValueProps> = ({
bgColor ?? ""
} text-xs ${fgColor ?? ""}`}
>
$<span className="font-balance">{formatFiatValue(value, decimals)}</span>
{value.isNegative() ? <span className="font-balance">-</span> : null}$
<span className="font-balance">
{formatFiatValue(
value.isNegative() ? value.mul(FixedNumber.fromValue(-1n)) : value,
decimals,
)}
</span>
</span>
);

Expand Down

0 comments on commit 043b155

Please sign in to comment.