Skip to content

Commit

Permalink
🐛 Fix hardcoded usd currency
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenandre committed Feb 2, 2022
1 parent 0a639b0 commit e3c7dc0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/Widgets/CryptoWatchList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
>
<img class="icon" :src="asset.image" :alt="`${asset} icon`" />
<p class="name">{{ asset.name }}</p>
<p class="price">{{ asset.price | formatPrice }}</p>
<p class="price">{{ asset.price | formatPrice(currency) }}</p>
<p :class="`percent ${asset.percentChange > 0 ? 'up' : 'down'}`">
{{ asset.percentChange | formatPercentage }}
</p>
Expand Down Expand Up @@ -70,8 +70,9 @@ export default {
},
filters: {
/* Append currency symbol to price */
formatPrice(price) {
return `${findCurrencySymbol('usd')}${putCommasInBigNum(roundPrice(price))}`;
formatPrice(price, currency) {
if (currency === undefined) return '';
return `${findCurrencySymbol(currency)}${putCommasInBigNum(roundPrice(price))}`;
},
/* Append percentage symbol, and up/ down arrow */
formatPercentage(change) {
Expand Down

0 comments on commit e3c7dc0

Please sign in to comment.