// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.math.BigDecimal;
import java.text.DecimalFormat;

public class BDFormat {
    public static void main(String[] args) {
        DecimalFormat fmt = new DecimalFormat("0.####################");
        BigDecimal bda = new BigDecimal("0.0002");
        BigDecimal bdb = new BigDecimal("0.0001");
        BigDecimal bdc = bda.add(bdb);
        System.out.println(bdc);
        System.out.println(fmt.format(bdc));
    }
}
