Java BigDecimal unformattedFromBigDecimal(BigDecimal n)

Here you can find the source of unformattedFromBigDecimal(BigDecimal n)

Description

Convert a BigDecimal to the unformatted form.

License

Open Source License

Parameter

Parameter Description
n A <i>BigDecimal</i>.

Return

A string.

Declaration

public static String unformattedFromBigDecimal(BigDecimal n) 

Method Source Code


//package com.java2s;
/*/*from w ww  .  j  a v a  2  s .c om*/
 * Copyright (C) 2015 Miquel Sas
 *
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program. If not, see
 * <http://www.gnu.org/licenses/>.
 */

import java.math.BigDecimal;

public class Main {
    /**
     * Convert a <i>BigDecimal</i> to the unformatted form.
     * 
     * @return A string.
     * @param n A <i>BigDecimal</i>.
     */
    public static String unformattedFromBigDecimal(BigDecimal n) {
        if (n == null) {
            return "";
        }
        return n.toPlainString();
    }
}

Related

  1. textToBigDecimal(String amountAsText)
  2. transferDonateAmount2Point(BigDecimal donateAmount)
  3. tryParseBigDecimal(Object val, BigDecimal defaultVal)
  4. tryToStoreAsIntegerBigDecimal(Object ob)
  5. tryToStoreAsRealBigDecimal(Object ob)
  6. unformattedToBigDecimal(String str)
  7. valueOf(final BigDecimal value)
  8. writeBigDecimal(BigDecimal val, DataOutput out)
  9. writeBigDecimal(final OutputStream out, @Nullable final BigDecimal value)