
Can anyone please explain why this happen? If i get SQL sum its total correct. My code is below.
private void calTotalSMV() {
    double ttl_smv = 0;
    for (int x = 0; x < OBJ_CALLER.DTMEMERG.getRowCount(); x++) {
        ttl_smv += Double.parseDouble(OBJ_CALLER.DTMEMERG.getValueAt(x, 3).toString());
        System.out.println("total smv = " + ttl_smv);
    }
    jLabel23.setText("" + ttl_smv);
}
 
     
     
    
Retain precision with Doubles in java – Paul Samsotha Oct 17 '13 at 06:06