Hi .. I would like to round off a number in a method and return the rounded number. I tried many different ways but I always got the same error message:
Matematik.java:70: error: incompatible types
return df.format(volym);
^
required: double
found: String
1 error
Code :import java.text.DecimalFormat; public static double volume (int r, int h) { DecimalFormat df = new DecimalFormat("#.##"); double volym=PI*r*r*h; return df.format(volym); }
