diff --git a/README.md b/README.md index 81d8d8e0..9c8430d3 100644 --- a/README.md +++ b/README.md @@ -410,6 +410,7 @@ codeburn currency GBP # set to British Pounds codeburn currency AUD # set to Australian Dollars codeburn currency JPY # set to Japanese Yen codeburn currency CNY # set to Chinese Yuan +codeburn currency RON # set to Romanian Leu codeburn currency # show current setting codeburn currency --reset # back to USD ``` diff --git a/gnome/indicator.js b/gnome/indicator.js index 36ba382a..6805c4d8 100644 --- a/gnome/indicator.js +++ b/gnome/indicator.js @@ -63,6 +63,7 @@ const CURRENCIES = [ { code: 'MXN', symbol: 'MX$' }, { code: 'ZAR', symbol: 'R ' }, { code: 'DKK', symbol: 'kr ' }, + { code: 'RON', symbol: 'lei ' }, { code: 'CNY', symbol: '¥' }, ]; diff --git a/mac/Sources/CodeBurnMenubar/AppStore.swift b/mac/Sources/CodeBurnMenubar/AppStore.swift index b041b2c7..03e88450 100644 --- a/mac/Sources/CodeBurnMenubar/AppStore.swift +++ b/mac/Sources/CodeBurnMenubar/AppStore.swift @@ -1188,7 +1188,7 @@ final class AppStore { } enum SupportedCurrency: String, CaseIterable, Identifiable { - case USD, GBP, EUR, AUD, CAD, NZD, JPY, CNY, CHF, INR, BRL, SEK, SGD, HKD, KRW, MXN, ZAR, DKK + case USD, GBP, EUR, AUD, CAD, NZD, JPY, CNY, CHF, INR, BRL, SEK, SGD, HKD, KRW, MXN, ZAR, DKK, RON var id: String { rawValue } var displayName: String { switch self { @@ -1210,6 +1210,7 @@ enum SupportedCurrency: String, CaseIterable, Identifiable { case .MXN: "Mexican Peso" case .ZAR: "South African Rand" case .DKK: "Danish Krone" + case .RON: "Romanian Leu" } } } diff --git a/mac/Sources/CodeBurnMenubar/CurrencyState.swift b/mac/Sources/CodeBurnMenubar/CurrencyState.swift index 5fc907a6..def6cf32 100644 --- a/mac/Sources/CodeBurnMenubar/CurrencyState.swift +++ b/mac/Sources/CodeBurnMenubar/CurrencyState.swift @@ -60,7 +60,8 @@ final class CurrencyState: Sendable { "CHF": "CHF", "SEK": "kr", "DKK": "kr", - "ZAR": "R" + "ZAR": "R", + "RON": "lei" ] } diff --git a/src/currency.ts b/src/currency.ts index 331d27de..d951c815 100644 --- a/src/currency.ts +++ b/src/currency.ts @@ -30,6 +30,7 @@ let active: CurrencyState = { code: 'USD', rate: 1, symbol: '$' } const USD: CurrencyState = { code: 'USD', rate: 1, symbol: '$' } const SYMBOL_OVERRIDES: Record = { CNY: '¥', + RON: 'lei', } // Intl.NumberFormat throws on invalid ISO 4217 codes, so we use it as a validator diff --git a/tests/currency-rounding.test.ts b/tests/currency-rounding.test.ts index 4fbb7d0d..385e0693 100644 --- a/tests/currency-rounding.test.ts +++ b/tests/currency-rounding.test.ts @@ -101,5 +101,6 @@ describe('getFractionDigits', () => { expect(getFractionDigits('GBP')).toBe(2) expect(getFractionDigits('INR')).toBe(2) expect(getFractionDigits('CNY')).toBe(2) + expect(getFractionDigits('RON')).toBe(2) }) })