Here you can find the source of toBigDecimal(Double d)
Parameter | Description |
---|---|
The | Double to be converted. |
null
when the input parameter is null
.
public static BigDecimal toBigDecimal(Double d)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010-2015 BSI Business Systems Integration AG. * 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.eclipse.org/legal/epl-v10.html * * Contributors://from w w w . j a v a2s .c o m * BSI Business Systems Integration AG - initial API and implementation ******************************************************************************/ import java.math.BigDecimal; public class Main { /** * Converts a Double to a BigDecimal. * * @param The * Double to be converted. * @return The converted BigDecimal. Returns <code>null</code> when the input parameter is <code>null</code>. */ public static BigDecimal toBigDecimal(Double d) { if (d == null) { return null; } return BigDecimal.valueOf(d); } }