big Decimal to Integer - Java java.math

Java examples for java.math:BigDecimal

Description

big Decimal to Integer

Demo Code


//package com.java2s;
import java.math.BigDecimal;

public class Main {


    public static Integer bigDecimal2Integer(Object obj) {
        if (obj == null) {
            return 0;
        }// www.j a v a 2  s .  c  o m
        BigDecimal bd = (BigDecimal) obj;
        return bd.intValue();
    }
}

Related Tutorials