Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
1 change: 1 addition & 0 deletions gnome/indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '¥' },
];

Expand Down
3 changes: 2 additions & 1 deletion mac/Sources/CodeBurnMenubar/AppStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion mac/Sources/CodeBurnMenubar/CurrencyState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ final class CurrencyState: Sendable {
"CHF": "CHF",
"SEK": "kr",
"DKK": "kr",
"ZAR": "R"
"ZAR": "R",
"RON": "lei"
]
}

Expand Down
1 change: 1 addition & 0 deletions src/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ let active: CurrencyState = { code: 'USD', rate: 1, symbol: '$' }
const USD: CurrencyState = { code: 'USD', rate: 1, symbol: '$' }
const SYMBOL_OVERRIDES: Record<string, string> = {
CNY: '¥',
RON: 'lei',
}

// Intl.NumberFormat throws on invalid ISO 4217 codes, so we use it as a validator
Expand Down
1 change: 1 addition & 0 deletions tests/currency-rounding.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})