I am reading "float" numbers which are up to 2 decimal places, such as below:
122
122.3
122.34
and need to convert them to integer value by multiplying (imagine storing dollars/cents)
int i;
double d;
scanf( "%lf", &d );
i = d * 100;
for example18.56
will be transformed into 1855
Is there any way to read value as a double and convert it to int correctly?
TIA