Java tutorial
//package com.java2s; public class Main { private static double roundDoubleToDecimal(double d) { d = d * 10; int i = (int) Math.round(d); d = (double) i / 10; return d; } }