Significant+Digits

This site gives a small sample of how to create significant digits, which are good for programs involving money.

code format="java5"

import java.text.*;

class sample { public static void main(String Args[]) {

DecimalFormat numberTest = new DecimalFormat("####0.00");

double deee = .0099999;

System.out.println(deee); System.out.println(numberTest.format(deee)); }

code the first one were to print .0099999 but the second one would print .01