zsh_root
2024-01-02 7b595546af704983dbafcd0d385c8768ddacefc2
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));
    }
 
}