2

I am having the below String

String money = "USD0.00" 

Want to convert this into org.joda.money.Money

Do I need to split the currency unit and double value here and need to set it as separately in Money. Or Any library api is there to convert this?

Youcef LAIDANI
  • 55,661
  • 15
  • 90
  • 140
Remo
  • 534
  • 7
  • 26

1 Answers1

5

You can use Money.parse().

From the documentation (emphasis mine)

The string format is '$currencyCode $amount' where there may be zero to many spaces between the two parts.

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95