double proportion = Double.parseDouble("3.1415926"); String format = String.format("%.2f", proportion);