I have a java string which has an dollar value and cents value after decimal points and starting with a + or - sign. I want to convert into cents and store it in a integer (it can have + or -). Also i need to check if the cents part (after decimal point) not more than 2 digits and throw an error message if exists
example :
String dollval= "12.23" ,"12","-0.09", "-99","-99.0", "-99.23","0.00"
int dollint = 1223,12,-9,-99,-00,-9923,0