Java examples for java.lang:double Format
round To Decimals
//package com.java2s; public class Main { public static double roundToDecimals(double d, int c) { int temp = (int) ((d * Math.pow(10, c))); return (((double) temp) / Math.pow(10, c)); }/* w w w . jav a2 s . com*/ }