Here you can find the source of addDouble(Integer i, Double d)
public static Integer addDouble(Integer i, Double d)
//package com.java2s; import java.text.DecimalFormat; public class Main { private static DecimalFormat integerFormatter = new DecimalFormat("######0"); public static Integer addDouble(Integer i, Double d) { if (d == null && i == null) { return null; } else if (d == null && i != null) { return i; } else if (d != null && i == null) { return Integer.valueOf(integerFormatter.format(d)); } else {//w ww . jav a 2s .co m return i + Integer.valueOf(integerFormatter.format(d)); } } }