Enhance client dashboard summary: Add current fiat value of Bitcoin holdings and wallet currency to the summary metrics. Update model and frontend to display current value and unrealized gains/losses, improving financial insights for users.
This commit is contained in:
parent
e05404fcab
commit
9821be0406
4 changed files with 62 additions and 1 deletions
|
|
@ -21,6 +21,20 @@ window.app = Vue.createApp({
|
|||
}).format(amount);
|
||||
},
|
||||
|
||||
formatCurrencyWithCode(amount, currencyCode) {
|
||||
if (!amount) return `${currencyCode} 0.00`;
|
||||
// Format with the provided currency code
|
||||
try {
|
||||
return new Intl.NumberFormat('en-US', {
|
||||
style: 'currency',
|
||||
currency: currencyCode,
|
||||
}).format(amount);
|
||||
} catch (error) {
|
||||
// Fallback if currency code is not supported
|
||||
return `${currencyCode} ${amount.toFixed(2)}`;
|
||||
}
|
||||
},
|
||||
|
||||
formatDate(dateString) {
|
||||
if (!dateString) return ''
|
||||
return new Date(dateString).toLocaleDateString()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue