support setting decimal separator and digit grouping symbol

This commit is contained in:
MaysWind
2024-06-29 17:12:22 +08:00
parent d9c8142c51
commit 399413a270
51 changed files with 1280 additions and 582 deletions
+5 -7
View File
@@ -420,6 +420,7 @@
<script>
import { mapStores } from 'pinia';
import { useSettingsStore } from '@/stores/setting.js';
import { useUserStore } from '@/stores/user.js';
import { useAccountsStore } from '@/stores/account.js';
import accountConstants from '@/consts/account.js';
@@ -459,7 +460,7 @@ export default {
};
},
computed: {
...mapStores(useSettingsStore, useAccountsStore),
...mapStores(useSettingsStore, useUserStore, useAccountsStore),
title() {
if (!this.editAccountId) {
return 'Add Account';
@@ -493,10 +494,10 @@ export default {
return this.$locale.getAllCurrencies();
},
allowedMinAmount() {
return transactionConstants.minAmount;
return transactionConstants.minAmountNumber;
},
allowedMaxAmount() {
return transactionConstants.maxAmount;
return transactionConstants.maxAmountNumber;
}
},
watch: {
@@ -647,10 +648,7 @@ export default {
return this.getDisplayCurrency(account.balance, account.currency);
},
getDisplayCurrency(value, currencyCode) {
return this.$locale.getDisplayCurrency(value, currencyCode, {
currencyDisplayMode: this.settingsStore.appSettings.currencyDisplayMode,
enableThousandsSeparator: this.settingsStore.appSettings.thousandsSeparator
});
return this.$locale.formatAmountWithCurrency(this.settingsStore, this.userStore, value, currencyCode);
},
chooseSuitableIcon(oldCategory, newCategory) {
setAccountSuitableIcon(this.account, oldCategory, newCategory);
+1 -4
View File
@@ -438,10 +438,7 @@ export default {
});
},
getDisplayCurrency(value, currencyCode) {
return this.$locale.getDisplayCurrency(value, currencyCode, {
currencyDisplayMode: this.settingsStore.appSettings.currencyDisplayMode,
enableThousandsSeparator: this.settingsStore.appSettings.thousandsSeparator
});
return this.$locale.formatAmountWithCurrency(this.settingsStore, this.userStore, value, currencyCode);
},
getAccountDomId(account) {
return 'account_' + account.id;