squants icon indicating copy to clipboard operation
squants copied to clipboard

Money#parseString throws NotImplementedError

Open vlovgr opened this issue 7 years ago • 1 comments

import squants.market._

Money.parseString("1000 USD")
// scala.NotImplementedError: an implementation is missing

vlovgr avatar Nov 14 '18 10:11 vlovgr

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...

hunterpayne avatar Jan 19 '19 09:01 hunterpayne