String format1 = "##.##"; DecimalFormat fm1 = new DecimalFormat( format1, new DecimalFormatSymbols(Locale.US)); fm1.format(right_answer[i]);