Skip to content

Commit e4f83bd

Browse files
committed
fix(services/ocp): update lookupTable to include currency based symbol for the locale _and_ the US based symbol
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 1756d58 commit e4f83bd

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

  • services/opencode/src/main/kotlin/com/getcode/opencode/model/financial

services/opencode/src/main/kotlin/com/getcode/opencode/model/financial/CurrencyCode.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.getcode.opencode.model.financial
22

33
import com.getcode.opencode.internal.extensions.getClosestLocale
44
import java.util.Currency
5+
import java.util.Locale
56

67
enum class CurrencyCode {
78
AED,
@@ -331,12 +332,10 @@ enum class CurrencyCode {
331332
val locale = currency.getClosestLocale()
332333
try {
333334
val currencyInstance = Currency.getInstance(currency.name)
334-
val symbol = currencyInstance.symbol
335+
val usSymbol = currencyInstance.getSymbol(Locale.US)
335336
val localeSymbol = currencyInstance.getSymbol(locale)
336-
when (currency) {
337-
JPY -> put(currency, setOf(symbol))
338-
else -> put(currency, setOf(symbol, localeSymbol))
339-
}
337+
338+
put(currency, setOf(usSymbol, localeSymbol))
340339
} catch (e: IllegalArgumentException) {
341340
// Skip currencies with no valid symbol
342341
}

0 commit comments

Comments
 (0)