I want to remove zeroes from my string as decimal places, but I am not able to do that. Also, I want the decimal places gone only if zeros are there else the decimal places will be there.
Example:
1234.00 should become 1234
1234.25 should remain 1234.25
Here is the code I am using to do that but its not working.
String price_normal2 ="1234.00";
if(price_normal2.contains(".00")){
price_normal2.replace(".00","");
Log.i("PRICEEEEE",""+price_normal2);
}
Please help me in this.