[JAVAMONEY-101] MonetaryAmount supports Minor and Major part Created: 24/Apr/15  Updated: 25/Apr/15

Status: Open
Project: javamoney
Component/s: API, Impl: RI
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: otaviojava Assignee: atsticks
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: naming


Looking with Joda-money we can work with the minor values, the cents, and the major parts. It`s really simple to do because we already have this information from Currency[1].

This information is really useful to many banks and gateways of payment such MOIP and Paypal.

So this issue has the goal to add:

  • getAmountMajor - Gets the amount in major units as an Long.
  • getAmountMinor - Gets the amount in minor units as an Long.
  • getMinorPart - Gets the minor part of the amount.

In the MonetaryAmount interface.

And in the construtor add of implementation:

  • ofMajor - Obtains an instance of Money from an amount in major units.
  • ofMinor - Obtains an instance of Money from an amount in minor units.

obs: obviously the name will be different to a more suitable.

Comment by atsticks [ 25/Apr/15 ]

We already have / can implement such a feature AFAIK as part of MonetaryFunctions implemented as MonetaryQuery. So I dont see any need for extending the MonetaryAmount interface. BTW we also discussed exactly these things in early stage of the JSR and decided to not add every kind of requirement to the already big MonetaryAmount interface.

[JAVAMONEY-58] Currency data source URL for IsoCurrencyOnlineProvider needs updating Created: 12/Aug/13  Updated: 05/Feb/15

Status: In Progress
Project: javamoney
Component/s: Library: JavaMoney Extensions
Affects Version/s: None
Fix Version/s: 1.0

Type: Bug Priority: Minor
Reporter: paulkmoore Assignee: atsticks
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


The URL which specifies the location of the currency source in net.java.javamoney.ri.ext.provider.iso.IsoCurrencyOnlineProvider#loadCurrencies method is no longer valid. The current source is:


which results in an Http 404.

I believe the replacement should be:


Comment by keilw [ 12/Aug/13 ]

As a first step I'm fixing the URL to the new version. Where CI server (Jenkins) would also allow us to run Integration Tests there should be some for external services such as this to flag whenever this or another URL changes in future.
Will externalize it into a properties file for easier maintenance, but ultimate customization should be possible similar to Java 7+ Currency class:
>Users can supersede the Java runtime currency data by creating a properties file named <JAVA_HOME>/lib/currency.properties. The contents of the properties file are key/value pairs of the ISO 3166 country codes and the ISO 4217 currency data >respectively. The value part consists of three ISO 4217 values of a currency, i.e., an alphabetic code, a numeric code, and a minor unit. Those three
>ISO 4217 values are separated by commas. The lines which start with '#'s are considered comment lines. For example,...

either we'd use this file or introduce another one or two additional files (not too many, otherwise it gets confusing and we'd have a Spring-like maze of properties

Comment by keilw [ 13/Aug/13 ]

Changed, those URLs are now loaded from a properties file, but neither of the URLs looks like it gets results from parsing
I suppose the 404 error was mainly a browser-based observation, so there may be something left to do.

Debug information (if log level is changed appropriately or System.out/IDE-debugging used) tells currencies is empty, while the list of countries contains 249 of them.

Comment by paulkmoore [ 13/Aug/13 ]

Werner, the mapping also appears to have changed - I guess they did this as part of the "move"...

From the comments in code the previous feed appears to be structured as follows:

// ...

Whereas the new feed is as follows:

<ISO_4217 Pblshd="">
Comment by keilw [ 02/Sep/14 ]

This has been open for a while, does it work now?

Generated at Sun Apr 26 05:23:43 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.