Here you can find the source of round2(double num)
public static double round2(double num)
//package com.java2s; //License from project: Apache License public class Main { public static double round2(double num) { double result = num * 100; result = Math.round(result); result = result / 100;// ww w. j a v a 2 s.c o m return result; } }