🩹 Minor formatting fix for stock and crypto price widgets

This commit is contained in:
Alicia Sykes 2021-12-29 12:51:29 +00:00
parent 9933766adf
commit c4ac847fc4
2 changed files with 6 additions and 4 deletions

View File

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

View File

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