You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since now it's possible to define our additional currencies, I expect to be able to create a new Money passing a currency code from the additional ones I added, like in the example above:
object NMY extends Currency("NMY", "New Money", "$", 2)
implicit val myContext = moneyContext.withAdditionalCurrencies(Set(NMY))
val money = Money(10, "NMY")
However, the snippet of code above is throwing an exception, since Money.apply(amount: BigDecimal, currency: String) is using a static defaultCurrencyMap for the String-to-Currency conversion, instead of the list of currencies from the implicit context.
The text was updated successfully, but these errors were encountered:
I tried to make this work in my sandbox and ended up breaking the JS platform build in a way I don't understand. So this seems to be a difficult to fix issue and might require some larger refactoring of the market package. Also, the easy workaround is to directly use the currency object.
Perhaps an implicit conversion from String -> Currency and removing the apply methods that take currency as a String is a better fix in the short run. Not sure how that would work as implicit conversions should always work and this one would fail part of the time.
Since now it's possible to define our additional currencies, I expect to be able to create a new
Money
passing a currency code from the additional ones I added, like in the example above:However, the snippet of code above is throwing an exception, since
Money.apply(amount: BigDecimal, currency: String)
is using a staticdefaultCurrencyMap
for the String-to-Currency conversion, instead of the list of currencies from the implicit context.The text was updated successfully, but these errors were encountered: