aspose file tools*
The moose likes Beginning Java and the fly likes Is there a library that deals with currency? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Is there a library that deals with currency?" Watch "Is there a library that deals with currency?" New topic
Author

Is there a library that deals with currency?

Debi Manson
Greenhorn

Joined: Aug 26, 2007
Posts: 2
I'm really new to Java and was wondering if there was a library in the API that deals with currency that could be used in monetary calculations or conversions?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39393
    
  28
Welcome to the Ranch.

Difficult to be sure what you require. There is a Currency class, and up to J2SE1.4 you would have used DecimalFormat to print the result. Nowadays, you would use the formatting tags in System.out.printf for formatting; there are more details in the Formatter class API. You would use the BigDecimal class to do any arithmetic. Have a look at the Java Tutorial about formatting and currency.

And I hope that lot is of some help to you.

CR
Debi Manson
Greenhorn

Joined: Aug 26, 2007
Posts: 2
Thank you! That's just what I needed.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Originally posted by Debi Manson:
if there was a library in the API that deals with currency that could be used in monetary calculations or conversions?


bless you for not using Floating Point for currency.
David Irwin
Ranch Hand

Joined: Mar 25, 2004
Posts: 82
You might also check out the JScience library. In addition to supporting currencies it also supports a wide variety of unit and unit conversions (it's a reference implementation of JSR-275). Check out the API for more details.

Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is there a library that deals with currency?