money « double « Java Data Type Q&A





1. Double my money: my framework uses doubles for monetary amounts    stackoverflow.com

I've inherited a project in which monetary amounts use the double type. Worse, the framework it uses, and the framework's own classes, use double for money. The framework ORM also handles ...

2. Money Problems ... double dose not work ..    java-forums.org

Hi everyone Iv done a bit of searching on this subject and i realize that their is a problem with financial calculations using doubles although iv read about bigdecimal and floating point but i am not sure how to implement them for my problem. Actually as I am relatively new to java (and maths) I am not even sure if I ...

3. Correct way to use double type to represent money quantities    forums.oracle.com

I was assigned a project where I had to create a class that received money quantities as double numbers and that implemented a method returning a quantity of money as double. I have to use this scheme as we have no seen other data types in class. My question is, what can I do to make sure that the value I'm ...

4. Handling money with doubles    forums.oracle.com

You can format floats and doubles with String.format or java.text.DecimalFormat. But using floats and doubles to represent money is generally considered a bad idea anyway. They're floating point binary representations and there can be rounding issues which I won't go into right now. Generally there are two better options: 1) use java.math.BigDecimal 2) use an integer, and instead of storing dollars ...