Java - Float Approximate
1 2 float a = 10F; 3 float b = 3F; 4 float c = a/b; 5 6 NumberFormat nf = NumberFormat.getInstance(); 7 8 System.out.println(nf.format(c));
DZone Snippets > whitetiger > float
13503 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
1 2 float a = 10F; 3 float b = 3F; 4 float c = a/b; 5 6 NumberFormat nf = NumberFormat.getInstance(); 7 8 System.out.println(nf.format(c));