Subtracting Whole Number from a fraction.

 

Hi!

1.At a certain point of calculation when I have a number like this(i.e) -> 3.647 remaining, I need to remove(subtract) 3 so I would have 0.647 for further calculations.

Also I do not know which whole number it would be.

2.How do I get these 3 digits from a price reading ,i.e: 

  0.87130

  How do I get 713 from it for further calculation

Thanks a lot. 

 
t0mbfunk:

1. 3.647 remaining, I need to remove(subtract) 3 so I would have 0.647 for further calculations.

2 0.87130 How do I get 713 from it for further calculation
double v1 = 3.647;  double f1 = v1 - int(v1); // 0.647
double v2 = 0.8713; int    i1 = v2 / 10000;   // 8713
                    int    i2 = i1 % 1000;    //  713
 
Thank you man
Reason: