From c4ac847fc47a457a480bd5926410c3a87502b17f Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 29 Dec 2021 12:51:29 +0000 Subject: [PATCH] :adhesive_bandage: Minor formatting fix for stock and crypto price widgets --- src/components/Widgets/CryptoWatchList.vue | 6 ++++-- src/components/Widgets/StockPriceChart.vue | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Widgets/CryptoWatchList.vue b/src/components/Widgets/CryptoWatchList.vue index 0f11f232..7b86ad25 100644 --- a/src/components/Widgets/CryptoWatchList.vue +++ b/src/components/Widgets/CryptoWatchList.vue @@ -22,7 +22,9 @@ import axios from 'axios'; import WidgetMixin from '@/mixins/WidgetMixin'; import { widgetApiEndpoints } from '@/utils/defaults'; -import { findCurrencySymbol, timestampToDate, roundPrice } from '@/utils/MiscHelpers'; +import { + findCurrencySymbol, timestampToDate, roundPrice, putCommasInBigNum, +} from '@/utils/MiscHelpers'; export default { mixins: [WidgetMixin], @@ -69,7 +71,7 @@ export default { filters: { /* Append currency symbol to price */ formatPrice(price) { - return `${findCurrencySymbol('usd')}${roundPrice(price)}`; + return `${findCurrencySymbol('usd')}${putCommasInBigNum(roundPrice(price))}`; }, /* Append percentage symbol, and up/ down arrow */ formatPercentage(change) { diff --git a/src/components/Widgets/StockPriceChart.vue b/src/components/Widgets/StockPriceChart.vue index 15a3829c..68eec186 100644 --- a/src/components/Widgets/StockPriceChart.vue +++ b/src/components/Widgets/StockPriceChart.vue @@ -121,9 +121,9 @@ export default { }); // // Combine results with chart config this.chartData = { - labels: priceLabels, + labels: priceLabels.reverse(), datasets: [ - { name: `Price ${this.priceTime}`, type: 'bar', values: priceValues }, + { name: `Price ${this.priceTime}`, type: 'bar', values: priceValues.reverse() }, ], }; // // Call chart render function