> > I used a float that fixt the problem
>
> Did you even read the suggestions given to you?
He has no need to do that: the prob has been sol...
Edit:
@StreLochKi:
A float also suffers from the same inaccuracy than a double. Since a float is less precise as a double, it only looks like your problem has been solved.
Anyway, try reading this document to understand the limitations of floating point arithmetic:
http://java.sun.com/developer/JDCTechTips/2003/tt0204.html#2
So, as already suggested: either use a formatter like DecimalFormat to display your number upto a certain precision, or use BigDecimal for arbitrary precision arithmetic.
Good luck.
incidentally, OP, if you do decide to use BigDecimal, use the constructor that takes a String argument. this is the only way to guarantee the precision you want. eg
BigDecimal bd = new BigDecimal("100.0000000000");
bd is now precise to ten decimal places. using doubles or other primitives will make your BigDecimal adopt the precision of that primitive number