//格式化
List list = new ArrayList() ;
DecimalFormat myFormat = new DecimalFormat("###,##0.000000");
DecimalFormat myFormat1 = new DecimalFormat("###,##0.0");
String value = "" ;
list.add("Long0") ;
list.add("Short0") ;
list.add("Current0") ;
for(int i=0 ;i<list.size();i++){
for(int j=1; j<=4; j++){
if(getDoubleValue("income01"+list.get(i)+j) == 0){
value = myFormat1.format(getDoubleValue("income01"+list.get(i)+j)) ;
request.setAttribute("income01"+list.get(i)+j, value) ;
}else{
value = myFormat.format(getDoubleValue("income01"+list.get(i)+j)) ;
request.setAttribute("income01"+list.get(i)+j, value) ;
}
if(getDoubleValue("cost01"+list.get(i)+j) == 0){
value = myFormat1.format(getDoubleValue("cost01"+list.get(i)+j)) ;
request.setAttribute("cost01"+list.get(i)+j, value) ;
}else{
value = myFormat.format(getDoubleValue("cost01"+list.get(i)+j)) ;
request.setAttribute("cost01"+list.get(i)+j, value) ;
}
if(getDoubleValue("profit01"+list.get(i)+j) == 0){
value = myFormat1.format(getDoubleValue("profit01"+list.get(i)+j)) ;
request.setAttribute("profit01"+list.get(i)+j, value) ;
}else{
value = myFormat.format(getDoubleValue("profit01"+list.get(i)+j)) ;
request.setAttribute("profit01"+list.get(i)+j, value) ;
}
} //end for
}//end for