Hi All,
Trying to take a value "subTotal" and have a running total on it. Once running total is complete, I need to do a number format on it and display. Everthing compiles fine. But when I run the code, the following error occurs at:
subTotal = subTotal + new Double(FTinfo1.getDefaultValue()).doubleValue();
java.lang.NumberFormatException: $123,456.12
at java.lang.FloatingDecimal.readjavaFormatString(FloatingDecimal.java:1173)
at java.lang.Double.valueOf(Double.java:165)
at java.lang.Double.<init>(Double.java:165)
...
--if you need more info, I'll get it to you.
Any suggestions/comments would be most welcome.
TIA,
Tim
Trying to take a value "subTotal" and have a running total on it. Once running total is complete, I need to do a number format on it and display. Everthing compiles fine. But when I run the code, the following error occurs at:
subTotal = subTotal + new Double(FTinfo1.getDefaultValue()).doubleValue();
java.lang.NumberFormatException: $123,456.12
at java.lang.FloatingDecimal.readjavaFormatString(FloatingDecimal.java:1173)
at java.lang.Double.valueOf(Double.java:165)
at java.lang.Double.<init>(Double.java:165)
...
--if you need more info, I'll get it to you.
Code:
...
for(int k = 0; tmpRows > k; k++) {
FieldTemplate FTinfo1 = (FieldTemplate)dataFT.elementAt(k);
if(FTinfo1.getFieldDisplayText().equals("Amount")) {
System.out.println("HERE 1");
subTotal = subTotal + new Double(FTinfo1.getDefaultValue()).doubleValue();
System.out.println("subTotal " + subTotal);
double itemTotal = subTotal;
System.out.println("HERE 2 " + itemTotal);
NumberFormat nf = NumberFormat.getCurrencyInstance();
System.out.println("HERE 3");
tmpTotal = nf.format(itemTotal);
System.out.println("HERE 4");
}
%>
...
Any suggestions/comments would be most welcome.
TIA,
Tim