File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Double Value Round Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Double Value Round Problem" Watch "Double Value Round Problem" New topic
Author

Double Value Round Problem

shashi wagh
Ranch Hand

Joined: Oct 30, 2008
Posts: 38
I have written a function to Round the Double value upto 2 decimal point it works fine
but for some value is gives wrong result

Here is the Code



Wrong Out put is as follows for 66089.1

multiply==>100.0
value * multiply==>6608910.000000001
66089.11

Correct Out put is as follows for 66089.34578

multiply==>100.0
value * multiply==>6608934.578000001
66089.35


Pleas help me
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Read this.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Double Value Round Problem
 
Similar Threads
decimal precision
Wrappers and floats comparision
Double subtraction error
Double Value Problem