Download MetaTrader 5
To add comments, please log in or register
Let your idle PCs do something useful. Join MQL5 Cloud Network!
derek portland
241
derek portland 2014.07.18 17:34 

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. 

whroeder1
13627
whroeder1 2014.07.18 18:05  
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
derek portland
241
derek portland 2014.07.19 07:42  
Thank you man
/
To add comments, please log in or register