Joda-Money

表示货币金额的 Java 库。「Java library to represent monetary amounts.」

  • 所有者: JodaOrg/joda-money
  • 平台: Linux,Mac,Windows,BSD,Unix-like,Solaris
  • 許可證: Apache License 2.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Joda-Money

Joda-Money provides a library of classes to store amounts of money.

Joda-Money does not provide, nor is it intended to provide, monetary algorithms beyond the most basic and obvious.
This is because the requirements for these algorithms vary widely between domains.
This library is intended to act as the base layer, providing classes that should be in the JDK.

As a flavour of Joda-Money, here's some example code:

// create a monetary value
Money money = Money.parse("USD 23.87");

// add another amount with safe double conversion
CurrencyUnit usd = CurrencyUnit.of("USD");
money = money.plus(Money.of(usd, 12.43d));

// subtracts an amount in dollars
money = money.minusMajor(2);

// multiplies by 3.5 with rounding
money = money.multipliedBy(3.5d, RoundingMode.DOWN);

// compare two amounts
boolean bigAmount = money.isGreaterThan(dailyWage);

// convert to GBP using a supplied rate
BigDecimal conversionRate = ...;  // obtained from code outside Joda-Money
Money moneyGBP = money.convertedTo(CurrencyUnit.GBP, conversionRate, RoundingMode.HALF_EVEN);

// use a BigMoney for more complex calculations where scale matters
BigMoney moneyCalc = money.toBigMoney();

Users are reminded that this software, like all open source software, is provided
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.

Joda-Money is licensed under the business-friendly Apache 2.0 licence.

Documentation

Various documentation is available:

Releases

Release 1.0.1 is the current release.
This release is considered stable and worthy of the 1.x tag.
It depends on Java SE 8 or later.

Joda-Money does have a compile-time dependency on Joda-Convert, but this is not required at runtime
thanks to the magic of annotations.

Available in the Maven Central repository

Tidelift dependency check

Support

Please use Stack Overflow for general usage questions.
GitHub issues and pull requests
should be used when you want to help advance the project.
Commercial support is available via the
Tidelift subscription.

To report a security vulnerability, please use the Tidelift security contact.
Tidelift will coordinate the fix and disclosure.

Release process

  • Update version (README.md, index.md, changes.xml)
  • Commit and push
  • mvn clean release:clean release:prepare release:perform
  • git fetch
  • Website will be built and released by Travis

主要指標

概覽
名稱與所有者JodaOrg/joda-money
主編程語言Java
編程語言Java (語言數: 3)
平台
許可證Apache License 2.0
所有者活动
創建於2011-05-10 14:55:09
推送於2025-03-17 22:05:33
最后一次提交
發布數20
最新版本名稱v2.0.2 (發布於 2025-03-17 22:02:38)
第一版名稱v0.5 (發布於 )
用户参与
星數666
關注者數25
派生數119
提交數421
已啟用問題?
問題數84
打開的問題數8
拉請求數60
打開的拉請求數1
關閉的拉請求數12
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?