Programming Reference/Librarys
Question & Answer
Q&A is closed
rounds a number
package roundanumber; import java.lang.Math; public class Roundanumber { public static void main(String[] args) { // TODO code application logic here double number, number2; number = 33.384422; number2 = 33.898823; System.out.println("number: " + Math.round(number)); System.out.println("number2: " + Math.round(number2)); } }
number: 33 number2: 34