mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-22 11:05:17 +00:00
parent
c6a866b96c
commit
d0beeda943
|
@ -145,16 +145,18 @@ export default class TradeList extends Vue {
|
|||
{ key: 'trade_id', label: 'ID' },
|
||||
{ key: 'pair', label: 'Pair' },
|
||||
{ key: 'amount', label: 'Amount' },
|
||||
{ key: 'stake_amount', label: 'Stake amount' },
|
||||
{
|
||||
key: 'stake_amount',
|
||||
label: 'Stake amount',
|
||||
formatter: (value: number) => this.formatPriceWithDecimals(value),
|
||||
},
|
||||
{
|
||||
key: 'open_rate',
|
||||
label: 'Open rate',
|
||||
formatter: (value: number) => this.formatPriceWithDecimals(value),
|
||||
},
|
||||
{
|
||||
key: this.activeTrades ? 'current_rate' : 'close_rate',
|
||||
label: this.activeTrades ? 'Current rate' : 'Close rate',
|
||||
formatter: (value: number) => this.formatPriceWithDecimals(value),
|
||||
},
|
||||
{
|
||||
key: 'profit',
|
||||
|
|
|
@ -10,8 +10,14 @@ export function formatPercent(value: number, decimals = 3): string {
|
|||
return !isUndefined(value) ? `${(value * 100).toFixed(decimals)}%` : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Format number to `decimals` without trailing zeros
|
||||
* @param value Number to format
|
||||
* @param decimals number of decimals (Defaults to 8)
|
||||
* @returns Formatted string
|
||||
*/
|
||||
export function formatPrice(value: number, decimals = 8): string {
|
||||
return !isUndefined(value) ? value.toFixed(decimals) : '';
|
||||
return !isUndefined(value) ? parseFloat(value.toFixed(decimals)).toString() : '';
|
||||
}
|
||||
|
||||
export function dateFromString(datestring: string, format: string): Date {
|
||||
|
|
Loading…
Reference in New Issue
Block a user