You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Your post does not have a question. What is it that you wish to know?
In your examples, both "c1 = a1 / b1" and "c2 = a2 / b2", carry out integer division. Even if the results are assigned to a "double", they are still the results of integer division.
If that is not want you want or expect, then apply typecasting as shown in my examples so that it will carry out floating point division.
Your post does not have a question. What is it that you wish to know?
In your examples, both "c1 = a1 / b1" and "c2 = a2 / b2", carry out integer division. Even if the results are assigned to a "double", they are still the results of integer division.
If that is not want you want or expect, then apply typecasting as shown in my examples so that it will carry out floating point division.
As I stated, learn about typecasting — Typecasting - Data Types - Language Basics - MQL4 Reference.
Don't use string manipulation. That is incorrect and inefficient.
... or more simply, you can rely on implicit typecasting ...
... or inline typecasting ...