Enhance currency formatting in MoneyHistoryView component
This commit is contained in:
@@ -22,9 +22,9 @@
|
||||
<tbody>
|
||||
<tr v-for="(entry, index) in moneyHistory.data" :key="index">
|
||||
<td>{{ translateActivity(entry.activity) }}</td>
|
||||
<td>{{ entry.moneyBefore }}</td>
|
||||
<td>{{ entry.moneyAfter }}</td>
|
||||
<td>{{ entry.changeValue }}</td>
|
||||
<td>{{ entry.moneyBefore != null ? Number(entry.moneyBefore).toLocaleString(locale, { style: 'currency', currency: 'EUR' }) : '---' }}</td>
|
||||
<td>{{ entry.moneyAfter != null ? Number(entry.moneyAfter).toLocaleString(locale, { style: 'currency', currency: 'EUR' }) : '---' }}</td>
|
||||
<td>{{ entry.changeValue != null ? Number(entry.changeValue).toLocaleString(locale, { style: 'currency', currency: 'EUR' }) : '---' }}</td>
|
||||
<td>{{ new Date(entry.time).toLocaleString() }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -54,6 +54,11 @@ export default {
|
||||
components: {
|
||||
StatusBar,
|
||||
},
|
||||
computed: {
|
||||
locale() {
|
||||
return window.navigator.language || 'en-US';
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filter: '',
|
||||
@@ -92,6 +97,9 @@ export default {
|
||||
}
|
||||
return translation !== key ? translation : activity;
|
||||
},
|
||||
locale() {
|
||||
return window.navigator.language || 'en-US';
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user