Hi,
I am having two formatted numbers to be added Limit1 and Limit2
String Limit1=7,500.00;
String Limit2=7,000.00;
I have to add these two and get the result as 14,500.00
I followed the normal procedure with for loop and sustring.
my code is
String aloplimit1="";
for(int i=0;i<Limit1.length();i++)
{
if(!(Limit1.substring(i,i+1)).equals(",") && !(Limit1.substring(i,i+1)).equals("."))
aloplimit1+=Limit1.substring(i,i+1);
}
int aLimit=Integer.parseInt(aloplimit1);
same for Limit2
---
---
int bLimit=Integer.parseInt(aloplimit2);
int limit= aLimit+bLimit;
then formatted limit.
Please can any one tell me is there anyway to do this using numbers formatting with out writing lengthy code??
Thanks