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

Money#parseString throws NotImplementedError #322

Open
vlovgr opened this issue Nov 14, 2018 · 1 comment
Open

Money#parseString throws NotImplementedError #322

vlovgr opened this issue Nov 14, 2018 · 1 comment

Comments

@vlovgr
Copy link

vlovgr commented Nov 14, 2018

import squants.market._

Money.parseString("1000 USD")
// scala.NotImplementedError: an implementation is missing
@hunterpayne
Copy link
Contributor

hunterpayne commented Jan 19, 2019

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

Vrolijkx pushed a commit to Vrolijkx/squants that referenced this issue Sep 13, 2019
Vrolijkx pushed a commit to Vrolijkx/squants that referenced this issue Sep 13, 2019
Vrolijkx pushed a commit to Vrolijkx/squants that referenced this issue Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants