I am currently developing a system for accepting credit/debit card payments and processing SEPA transactions. I am working with the Euro currency, where it is necessary to support 2 decimal places, but the calculation of the commission requires 8 decimal places. The first thing that comes to mind are the primitive datatypes float and double, but they are not suitable for calculating money. This is due to the peculiarities of floating point representation. Instead, you should use BigDecimal.