Java BigDecimal Floor floor(BigDecimal x)

Here you can find the source of floor(BigDecimal x)

Description

floor

License

Open Source License

Declaration

public static BigInteger floor(BigDecimal x) 

Method Source Code


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

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

public class Main {
    public static BigInteger floor(BigDecimal x) {
        return x.setScale(0, RoundingMode.FLOOR).unscaledValue();
    }/*ww  w . jav  a  2  s.  c o m*/
}

Related

  1. floor(BigDecimal dividend, int divisor)
  2. floor1(BigDecimal number)