Skip to content

A local-first personal finance app

[AI] Use CHF as the Swiss franc currency symbol (#9247)

zotabee08b0deaf68a0
diff --git a/packages/desktop-client/src/components/settings/Currency.tsx b/packages/desktop-client/src/components/settings/Currency.tsx
index 00eb4eb57e..7b18132a87 100644
--- a/packages/desktop-client/src/components/settings/Currency.tsx
+++ b/packages/desktop-client/src/components/settings/Currency.tsx
@@ -114,7 +114,9 @@ export function CurrencySettings() {
const cur = getCurrency(code);
setNumberFormatPref(cur.numberFormat);
setHideFractionPref(cur.decimalPlaces === 0 ? 'true' : 'false');
- setSpaceEnabledPref(cur.symbolFirst ? 'false' : 'true');
+ // A currency code used as the symbol (e.g. "CHF 100") needs a space
+ const isSpaceEnabled = !cur.symbolFirst || cur.symbol === cur.code;
+ setSpaceEnabledPref(isSpaceEnabled ? 'true' : 'false');
setSymbolPositionPref(cur.symbolFirst ? 'before' : 'after');
}
};
diff --git a/packages/loot-core/src/shared/currencies.ts b/packages/loot-core/src/shared/currencies.ts
index d74e26a73d..e86293aede 100644
--- a/packages/loot-core/src/shared/currencies.ts
+++ b/packages/loot-core/src/shared/currencies.ts
@@ -28,7 +28,7 @@ export const currencies: Currency[] = [
{ code: 'BRL', name: 'Brazilian Real', symbol: 'R$', decimalPlaces: 2, numberFormat: 'dot-comma', symbolFirst: true },
{ code: 'BYN', name: 'Belarusian Ruble', symbol: 'Br', decimalPlaces: 2, numberFormat: 'space-comma', symbolFirst: false },
{ code: 'CAD', name: 'Canadian Dollar', symbol: 'CA$', decimalPlaces: 2, numberFormat: 'comma-dot', symbolFirst: true },
- { code: 'CHF', name: 'Swiss Franc', symbol: 'Fr.', decimalPlaces: 2, numberFormat: 'apostrophe-dot', symbolFirst: true },
+ { code: 'CHF', name: 'Swiss Franc', symbol: 'CHF', decimalPlaces: 2, numberFormat: 'apostrophe-dot', symbolFirst: true },
{ code: 'CLP', name: 'Chilean Peso', symbol: 'CLP$', decimalPlaces: 2, numberFormat: 'dot-comma', symbolFirst: true },
{ code: 'CNY', name: 'Yuan Renminbi', symbol: '¥', decimalPlaces: 2, numberFormat: 'comma-dot', symbolFirst: true },
{ code: 'COP', name: 'Colombian Peso', symbol: 'Col$', decimalPlaces: 2, numberFormat: 'dot-comma', symbolFirst: true },
diff --git a/upcoming-release-notes/use-chf-swiss-franc-symbol.md b/upcoming-release-notes/use-chf-swiss-franc-symbol.md
new file mode 100644
index 0000000000..62b8275d61
--- /dev/null
+++ b/upcoming-release-notes/use-chf-swiss-franc-symbol.md
@@ -0,0 +1,6 @@
+---
+category: Enhancements
+authors: [zotabee]
+---
+
+Show Swiss franc amounts with the official "CHF" abbreviation instead of "Fr."