Java BigDecimal Normalize normalize(BigDecimal bigDecimal)

Here you can find the source of normalize(BigDecimal bigDecimal)

Description

Nastavi standardni zaokrouhlovani.

License

Open Source License

Parameter

Parameter Description
bigDecimal a parameter

Declaration

public static BigDecimal normalize(BigDecimal bigDecimal) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;
import java.math.RoundingMode;

public class Main {
    public static final int STANDARD_SCALE = 2;
    public static final RoundingMode STANDARD_ROUNDING_MODE = RoundingMode.HALF_UP;

    /**/*from  w w  w.  j av a2s  .com*/
     * Nastavi standardni zaokrouhlovani.
     * 
     * @param bigDecimal
     */
    public static BigDecimal normalize(BigDecimal bigDecimal) {
        return bigDecimal.setScale(STANDARD_SCALE, STANDARD_ROUNDING_MODE);
    }
}

Related

  1. normalize(final BigDecimal dec)
  2. normalizeDecimalValue(BigDecimal bigDecimal, int allowedPrecision)
  3. normalizePrecision(String precision, BigDecimal... decimals)
  4. normalizeScale(BigDecimal bigDecimal)