||Pure Scala Wrapper||API|
Add the following to your sbt build (Scala 2.11.x and Scala 2.12.x):
libraryDependencies += "com.github.nscala-money" %% "nscala-money" % "0.13.0"
To support reading and writing JodaMoney objects using Play JSON 2.6, also add (Scala 2.11.x and Scala 2.12.x):
libraryDependencies += "com.github.nscala-money" %% "nscala-money-play-json" % "0.13.0"
If you want to use previous versions, you can find them here.
This is mostly a convenience wrapper around the Joda Money libraries, adding more pleasant syntax like operators for addition, subtraction, and comparison. Also, most fields usually available as
getField are now simply available as
field, following Scala convention. Some instances of
toX have also been shortened.
nscala-money-play-json helper adds support for Play JSON. Various
BigMoney are provided.
import com.github.nscala_money.money.Imports._ // For optional Play JSON support import com.github.nscala_money.money.json.PlayImports._
"USD 10.99".toMoney // returns org.joda.money.Money "USD".toCurrency // returns org.joda.money.CurrencyUnit "USD 10.99".toMoney + "USD 1.00".toMoney // returns org.joda.money.Money = USD 11.99
Please see Joda Money for a full explanation of key concepts and the API: http://www.joda.org/joda-money
Documentation of joda-money will also be helpful.
This wrapper library is intended to do for Joda Money what
nscala-time does for Joda Time. The project structure and much of the boilerplate (including this README) were taken directly from
Please submit bugs, questions, suggestions, or (ideally) contributions as issues and pull requests on Github.
David R. Bild
Copyright 2015-2016 David R. Bild
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License from the LICENSE.txt file or at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.