import java.math.BigDecimal;
import java.math.BigInteger;
/**
* decimal变量获取
*/
public class DecimalUtil {
/**
* 获取object的值
*
* @author fengshuonan
* @Date 2019-04-04 17:07
*/
public static Long getLong(Object object) {
if (object == null) {
return null;
}
if (object instanceof BigDecimal) {
return ((BigDecimal) object).longValue();
}
if (object instanceof BigInteger) {
return ((BigInteger) object).longValue();
}
if (object instanceof Long) {
return ((Long) object);
}
return null;
}
}
decimal变量获取
猜你喜欢
转载自blog.csdn.net/weixin_42590334/article/details/103455208
今日推荐
周排行