E
epicwinter
I don't understand how I am suppose to use the bigdecimal class. If i
do this:
BigDecimal total = new BigDecimal(0);
total.add(new BigDecimal(100));
total.add(new BigDecimal(112.222));
System.err.println("total: " +new Double(total.setScale(2,
java.math.BigDecimal.ROUND_HALF_UP).doubleValue()));
The output is zero. Why? Everytime you intialize the big decimal to
zero it won't function?
do this:
BigDecimal total = new BigDecimal(0);
total.add(new BigDecimal(100));
total.add(new BigDecimal(112.222));
System.err.println("total: " +new Double(total.setScale(2,
java.math.BigDecimal.ROUND_HALF_UP).doubleValue()));
The output is zero. Why? Everytime you intialize the big decimal to
zero it won't function?