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" output value =1223 cents
String dollval= "12" output value = 1200 cents
String dollval= "-0.09" output value = -9 cents
String dollval= ""-99" output value = -99 cents
String dollval= "-99.0" output value = -99 cents
String dollval= "-99.23" output value =-9923 cents
String dollval="0.00 " output value=0 cents
String dollval="5.2" output val= 520 cents
String dollval = "5.20" output value =520 cents