This pull request fixes an issue with the USD balance view on the dashboard.
Essentially, the rounding is done in a way where the USD value can round to a single decimal place, even though USD values are properly represented with two decimal places.
This is essentially the logic that exists today:
"$" + Number(150.1.toFixed(2)).toLocaleString()
The problem with this is that casting to Number() removes the attempt at pinning the number of decimals via .toFixed().
The solution is to use Numbers native currency styling support:
This pull request fixes an issue with the USD balance view on the dashboard.
Essentially, the rounding is done in a way where the USD value can round to a single decimal place, even though USD values are properly represented with two decimal places.
This is essentially the logic that exists today:
The problem with this is that casting to
Number()
removes the attempt at pinning the number of decimals via.toFixed()
.The solution is to use
Number
s native currency styling support:Then it looks correct