Here you can find the source of round(double a)
static public int round(double a)
//package com.java2s; //License from project: LGPL public class Main { static public int round(double a) { return (int) (((a + 0.5) * 10.0) / 10.0); }/*from w w w. j a va 2 s .c o m*/ static public int round(float a) { return (int) (((a + 0.5) * 10.0) / 10.0); } }