Here you can find the source of divideByTwo(BigDecimal number)
public static final BigDecimal divideByTwo(BigDecimal number)
//package com.java2s; /*//from w ww .j a v a 2s . co m * Copyright (c) 2010 Victor Volle. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.opensource.org/licenses/eclipse-1.0.php * * Contributors: * Victor Volle */ import java.math.BigDecimal; import java.math.MathContext; public class Main { public static final BigDecimal TWO = new BigDecimal("2"); public static final BigDecimal divideByTwo(BigDecimal number) { return number.divide(TWO, MathContext.DECIMAL32); } }