User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







java:lang:math:round

Math.round

rounds a number

example of round in java

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));
    }
}

output of Roundanumber

  number: 33
  number2: 34
advertising
java/lang/math/round.txt · Last modified: 2013/04/10 10:12 by 94.223.12.247

Impressum Datenschutz