Naveen Bangalore wrote:Yeah
So basically what im trying to achieve is impossible
No, it is by no means impossible. I have given links to one way to do it. What you have to do is remember there is a difference between how a number is stored as a primitive (you can find the details in
this Wikipedia article and its links to IEEE754-1985, but it is by no means easy to understand), and how a number is displayed on screen.
You should be able to achieve displays with DecimalFormat or the easier methods in the links I gave. You may be using DecimalFormat incorrectly.
You might be able to do it differently with
this class, but values not ending with .0 .5 .25 .125 etc should be entered as "1.23" not 1.23 to maintain precision.