🔀 Merge pull request #467 from rubenandre/fix-hardcoded-usd-cryptowatchlist-widget

🐛 Fix hardcoded usd currency
This commit is contained in:
Alicia Sykes 2022-02-02 22:07:49 +00:00 committed by GitHub
commit b0c493fb89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -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>
@ -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) {