Java BigDecimal floatValue(BigDecimal val)

Here you can find the source of floatValue(BigDecimal val)

Description

Berekent float waarde van BigDecimal

License

Open Source License

Parameter

Parameter Description
val om te zetten BigDecimal, mag null zijn.

Return

geeft float waarde van val of 0.0f indien null

Declaration

public static float floatValue(BigDecimal val) 

Method Source Code


//package com.java2s;
/*//w  w w .  jav a  2s  .  c o m
 * B3P Commons Core is a library with commonly used classes for webapps.
 * Included are clieop3, oai, security, struts, taglibs and other
 * general helper classes and extensions.
 *
 * Copyright 2000 - 2008 B3Partners BV
 * 
 * This file is part of B3P Commons Core.
 * 
 * B3P Commons Core 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.
 * 
 * B3P Commons Core 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 B3P Commons Core.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.math.BigDecimal;

public class Main {
    /**
     * Berekent float waarde van BigDecimal
     * @param val om te zetten BigDecimal, mag null zijn.
     * @return geeft float waarde van val of 0.0f indien null
     */
    public static float floatValue(BigDecimal val) {
        float tempFloat = 0.0f;
        if (val != null) {
            tempFloat = val.floatValue();
        }
        return tempFloat;
    }
}

Related

  1. exp(BigDecimal x, int scale)
  2. exponentialFormatBigDecimal(BigDecimal bd)
  3. expTaylor(BigDecimal x, int scale)
  4. extractBigDecimal(String value)
  5. firstNonZero(final BigDecimal... values)
  6. fromLongToBigDecimal(long longValue)
  7. getArcCosineFor(BigDecimal radians)
  8. getAsDouble(BigDecimal value)
  9. getBalance(BigDecimal balance)