Math okrągły java
Dostałem projekt do konwersji z cm na cal. Zrobiłem to: jak mogę zaokrąglić mój numer za pomocą Math.round?
import java.util.Scanner;
public class Centimer_Inch
{
public static void main (String[] args)
{
// 2.54cm is 1 inch
Scanner cm = new Scanner(System.in); //Get INPUT from pc-Keyboard
System.out.println("Enter the CM:"); // Write input
//double
double centimeters = cm.nextDouble();
double inches = centimeters/2.54;
System.out.println(inches + " Inch Is " + centimeters + " centimeters");
}
}