Code example for BigDecimal

Methods: doubleValuesetScale

0
		} 		 
		return null; 
	} 
	 
	public static double transformTwoDecimalDoubleNumber(double number) {
		BigDecimal bigD = new BigDecimal(number);
		bigD = bigD.setScale(decimalPlaces, BigDecimal.ROUND_HALF_UP);
		return bigD.doubleValue();
	} 
} 
Connect your IDE to all the code out there  Get Codota for Java