Java BigDecimal Ceiling ceil(BigDecimal x)

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

Description

ceil

License

Open Source License

Declaration

public static BigInteger ceil(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 ceil(BigDecimal x) {
        return x.setScale(0, RoundingMode.CEILING).unscaledValue();
    }/*from w ww  .  ja  v  a 2s.  c  o m*/
}

Related

  1. ceiling(BigDecimal dividend, int divisor)
  2. ceiling1(BigDecimal number)