I've researched and found that when dealing with currency, the best way to go about doing calculations is by the BigDecimal
class.
With that in mind, I'm working on a code that converts various types of foreign currency into US currency and vice-versa (specifically, a cashregister that takes foreign currency and converts it into US money, computes the change and returns this amount to the customer in foreign currency).
As of now, many of the methods use double
and two of them take in int
as a parameter to be used in computing the US currency.
Question:
Since I want to use the BigDecimal class in my calculations, should I change all my methods that make calculations involving doubles to a BigDecimal?