chaddu1256
IS-IT--Management
java.text.DecimalFormat decimalFormat = new java.text.DecimalFormat("0.0000"
this is at the top of the page and the code which im trying to use this is as follows
<%
//to test for null values
String va1 = "";
if (utilWrap1.getExtension8().toString().equals("0.000000"){
va1 = " ";
}
else{
va1 = decimalFormat.format(Double.parseDouble(utilWrap1.getExtension8()
}
%>
<td> <div align="center"><font size="2"><%=va1%></font></div></td>
Basically whats going on is Extension8 is pulling in a water meter reading from our oracle database. The default format for this meter reading is 0.000000 what we are trying to do is format this from 6 decimal places to 4 decimal places, but also to say that if the reading is 0 then dont show anything. Im having trouble applying formatting and the null statement to the same thing. Any help would be great. Thanx
this is at the top of the page and the code which im trying to use this is as follows
<%
//to test for null values
String va1 = "";
if (utilWrap1.getExtension8().toString().equals("0.000000"){
va1 = " ";
}
else{
va1 = decimalFormat.format(Double.parseDouble(utilWrap1.getExtension8()
}
%>
<td> <div align="center"><font size="2"><%=va1%></font></div></td>
Basically whats going on is Extension8 is pulling in a water meter reading from our oracle database. The default format for this meter reading is 0.000000 what we are trying to do is format this from 6 decimal places to 4 decimal places, but also to say that if the reading is 0 then dont show anything. Im having trouble applying formatting and the null statement to the same thing. Any help would be great. Thanx