Java BigDecimal scale2(BigDecimal valor)

Here you can find the source of scale2(BigDecimal valor)

Description

Retorna valor com scale = 2 e RoundingMode.FLOOR

License

Open Source License

Parameter

Parameter Description
valor a parameter

Declaration

public static BigDecimal scale2(BigDecimal valor) 

Method Source Code

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

import java.math.BigDecimal;

import java.math.RoundingMode;

public class Main {
    /**/*from  w  w w. j a va2 s.  co m*/
     * Retorna valor com scale = 2 e RoundingMode.FLOOR
     * @param valor
     * @return
     */
    public static BigDecimal scale2(BigDecimal valor) {
        if (null != valor)
            return valor.setScale(2, RoundingMode.FLOOR);
        else
            return valor;
    }
}

Related

  1. safeAddBD(BigDecimal bd1, BigDecimal bd2)
  2. safeNull(BigDecimal value)
  3. safeToBigDecimal(Object obj1)
  4. scalarMult(BigDecimal scalar, Vector a)
  5. scale(BigDecimal b1, BigDecimal b2)
  6. scaleCurrency(BigDecimal amount)
  7. secondsBigDecimalFromDuration(long s, int n)
  8. signum(final BigDecimal value)
  9. sine(BigDecimal x)