Your formula for standard deviation seems odd, you may want to check with google. However, that is not issue here.
You should only do the formatting on the return double value in the calling method not in the called method. See the changes below, I am assuming you want double with 2 decimal places, if not you can always ask google.
public static void main(String [] args){
double deviation = var(x);
DecimalFormat df = new DecimalFormat("#.##");
System.out.println("The standard deviation is " + df.format(deviation));
}
public static double var(double[] x) {
double deviation = Math.sqrt(sum/(x.length - 1));
return deviation;
}