|
@ -127,7 +127,25 @@ public class CommonUtil {
|
|
if(d==null){
|
|
if(d==null){
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
return new Double(d*100).intValue();
|
|
|
|
|
|
String currency = String.valueOf(d);
|
|
|
|
int index = currency.indexOf(".");
|
|
|
|
int length = currency.length();
|
|
|
|
Integer amLong = 0;
|
|
|
|
if(index == -1){
|
|
|
|
amLong = Integer.valueOf(currency+"00");
|
|
|
|
}else if(length - index >= 3){
|
|
|
|
String temp = String.valueOf(d);
|
|
|
|
amLong = Integer.valueOf((currency.substring(0, index+3)).replace(".", ""));
|
|
|
|
Integer i = Integer.valueOf(currency.substring(index+3,index+4));
|
|
|
|
if(i>=5){
|
|
|
|
amLong++;
|
|
|
|
}
|
|
|
|
}else if(length - index == 2){
|
|
|
|
amLong = Integer.valueOf((currency.substring(0, index+2)).replace(".", "")+0);
|
|
|
|
}else{
|
|
|
|
amLong = Integer.valueOf((currency.substring(0, index+1)).replace(".", "")+"00");
|
|
|
|
}
|
|
|
|
return amLong;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|