1
2
3
4
5
6
7
8
9
10
11
12
| package Method;
|
| import java.text.DecimalFormat;
|
| /**DOUBleתΪÕûÊý*/
| public class DoubleToInt {//ËÄÉáÎåÈë°Ñdoubleת»¯ÎªintÀàÐÍÕûÊý,0.5Ò²ÉáÈ¥,0.51½øÒ»
| static DecimalFormat myformat=new DecimalFormat("######0");
| public static int ToInt(Double dou){
| return Integer.parseInt(myformat.format(dou));
| }
|
| }
|
|