Which data type to use for manipulating currency
问题 I am trying to decide which data type shall i use for a financial application. I have read that Double or BigDecimal should be used. And i am confused between them. Any help in this regard will be highly appreciated 回答1: You almost certainly don't want to use floating-point types ( double , float , Double , Float ) to handle monetary amounts, especially if you will be performing computations on them. The main reason for this is that there are many simple-looking numbers that cannot be