You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by prasad kumar <pr...@yahoo.co.in> on 2007/06/04 09:48:17 UTC
is there anyway to store the previous added lateExtraAmount?
hi,
iam using struts, i have one class i.e LateExtra,in this class
i have wriiten the code like below
double lateExtraAmount = calc.calculateLateExtra(currentContract);
from the above iam getting the lateExtraAmount
for ex:intially the amount is 2000 After that i Updated the amount to 2500,
then the lateExtraAmount =Updated Amount-Intial amount i.e 500,
then After that iam setting the value as
model.setAmount(String.valueOf(lateExtraAmount));
After some time I updated the amount from 2500 to 2600 then lateExtraAmount=Updated Amount-Intial amount i.e 100.
but i want the previous added lateExtraAmount and Latest added lateExtraAmount .for that i have wriiten the code like below
String newLateExtraAmount=new Double(Double.parseDouble(model.getAmount())+lateExtraAmount).toString().
model.setAmount(String.valueOf(newLateExtraAmount));
but the problem with the above code is whenever iam going to that screen the amount is incrementing.
my problem is there anyway to store the previous added lateExtraAmount? so that i can add the previous added lateExtraAmount with Latest added lateExtraAmount.i will get the result properly
if anybody knows please assist me i have been trying from the last two days...
thanks,
prasad
---------------------------------
Heres a new way to find what you're looking for - Yahoo! Answers