Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Turkish lira to supported currencies #438

Merged
merged 1 commit into from
Dec 24, 2020
Merged
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
2 changes: 2 additions & 0 deletions shared/src/main/scala/squants/market/Money.scala
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ object ETH extends Currency("ETH", "Ether", "\u039E", 15)
object LTC extends Currency("LTC", "Litecoin", "\u0141", 15)
object ZAR extends Currency("ZAR", "South African Rand", "R", 2)
object NAD extends Currency("NAD", "Namibian Dollar", "N$", 2)
object TRY extends Currency("TRY", "Turkish lira", "₺", 2)

/**
* Support for Money DSL
Expand Down Expand Up @@ -512,6 +513,7 @@ object MoneyConversions {
def litecoin = LTC
def ZAR = Money(n, squants.market.ZAR)
def NAD = Money(n, squants.market.NAD)
def TRY = Money(n, squants.market.TRY)
}

class MoneyNumeric()(implicit mc: MoneyContext) extends Numeric[Money] {
Expand Down
2 changes: 1 addition & 1 deletion shared/src/main/scala/squants/market/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ package object market {
EUR, GBP, HKD, INR, JPY,
KRW, MXN, MYR, NOK, NZD,
RUB, SEK, XAG, XAU, BTC,
ETH, LTC, ZAR, NAD)
ETH, LTC, ZAR, NAD, TRY)

lazy val defaultMoneyContext = MoneyContext(USD, defaultCurrencySet, Nil)

Expand Down
1 change: 1 addition & 0 deletions shared/src/test/scala/squants/market/MoneySpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ class MoneySpec extends AnyFlatSpec with Matchers {
d.litecoin should be(LTC(d))
d.ZAR should be(ZAR(d))
d.NAD should be(NAD(d))
d.TRY should be(TRY(d))
}

it should "provide Numeric support within a MoneyContext with no Exchange Rates" in {
Expand Down