squants
squants copied to clipboard
Money#parseString throws NotImplementedError
import squants.market._
Money.parseString("1000 USD")
// scala.NotImplementedError: an implementation is missing
Add this to the Money object in Money.scala:
override def parseString(s: String): Try[Money] = apply(s)
Then add this to MoneySpec.scala:
it should "handle round trip parsing of money as a string" in { // Issue #321 val money = Money(1000d, USD) Money(money.toString) // Issue #322 Money.parseString("1000 USD") }
Make sure it all works on your end, then submit a PR...