Suppose we have a BigDecimal variable setted up like this, and we can't change the way of it's creation:
BigDecimal num = new BigDecimal(6.0053);
So we'll see the following 'pretty' value after an output:
System.out.println(num); //0053000000000000824229573481716215610504150390625
The only way I've found to resolve this problem was using BigDecimal.valueOf():
System.out.println(BigDecimal.valueOf(num.doubleValue())); //6.0053
But is there a more simple solution?
Thanks in advance.