mirror of https://github.com/Lissy93/dashy.git
🔀 Merge pull request #467 from rubenandre/fix-hardcoded-usd-cryptowatchlist-widget
🐛 Fix hardcoded usd currency
This commit is contained in:
commit
b0c493fb89
|
@ -9,7 +9,7 @@
|
||||||
>
|
>
|
||||||
<img class="icon" :src="asset.image" :alt="`${asset} icon`" />
|
<img class="icon" :src="asset.image" :alt="`${asset} icon`" />
|
||||||
<p class="name">{{ asset.name }}</p>
|
<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'}`">
|
<p :class="`percent ${asset.percentChange > 0 ? 'up' : 'down'}`">
|
||||||
{{ asset.percentChange | formatPercentage }}
|
{{ asset.percentChange | formatPercentage }}
|
||||||
</p>
|
</p>
|
||||||
|
@ -70,8 +70,9 @@ export default {
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
/* Append currency symbol to price */
|
/* Append currency symbol to price */
|
||||||
formatPrice(price) {
|
formatPrice(price, currency) {
|
||||||
return `${findCurrencySymbol('usd')}${putCommasInBigNum(roundPrice(price))}`;
|
if (currency === undefined) return '';
|
||||||
|
return `${findCurrencySymbol(currency)}${putCommasInBigNum(roundPrice(price))}`;
|
||||||
},
|
},
|
||||||
/* Append percentage symbol, and up/ down arrow */
|
/* Append percentage symbol, and up/ down arrow */
|
||||||
formatPercentage(change) {
|
formatPercentage(change) {
|
||||||
|
|
Loading…
Reference in New Issue