mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-25 12:35:15 +00:00
Format prices in daily stats
This commit is contained in:
parent
f6ea46712f
commit
da3460ca0f
|
@ -17,6 +17,7 @@
|
|||
import Vue from 'vue';
|
||||
import { mapActions, mapState } from 'vuex';
|
||||
import DailyChart from '@/components/charts/DailyChart.vue';
|
||||
import { formatPrice } from '@/shared/formatters';
|
||||
|
||||
export default Vue.extend({
|
||||
name: 'DailyStats',
|
||||
|
@ -28,8 +29,12 @@ export default Vue.extend({
|
|||
dailyFields() {
|
||||
return [
|
||||
{ key: 'date', label: 'Day' },
|
||||
{ key: 'abs_profit', label: 'Profit' },
|
||||
{ key: 'fiat_value', label: `In ${this.dailyStats.fiat_display_currency}` },
|
||||
{ key: 'abs_profit', label: 'Profit', formatter: (value) => formatPrice(value) },
|
||||
{
|
||||
key: 'fiat_value',
|
||||
label: `In ${this.dailyStats.fiat_display_currency}`,
|
||||
formatter: (value) => formatPrice(value, 2),
|
||||
},
|
||||
{ key: 'trade_count', label: 'Trades' },
|
||||
];
|
||||
},
|
||||
|
|
|
@ -5,8 +5,8 @@ export function formatPercent(value: number, decimals = 3): string {
|
|||
return value ? `${(value * 100).toFixed(decimals)}%` : '';
|
||||
}
|
||||
|
||||
export function formatPrice(value: number): string {
|
||||
return value ? value.toFixed(8) : '';
|
||||
export function formatPrice(value: number, decimals = 8): string {
|
||||
return value ? value.toFixed(decimals) : '';
|
||||
}
|
||||
|
||||
export function dateFromString(datestring: string, format: string): Date {
|
||||
|
|
Loading…
Reference in New Issue
Block a user