I have a double variable test. I want to extract the all digits before decimal point and two digits after the decimal point store the output in integer variables dollar, cents. how can i do it? I dont want any rounding to happen.
example:
double test= 12.1234
Output
int dollar =12;
int cents =12;
double test =1235.0
output
int dollar=1235
int cents =0