Robert_Clive: I'm trying to input a very small variable into an EA script:
However it is being rounded to -0.1; this is a significant problem. If I do not declare MyVar as an input variable the value obviously stays as is.
What can I do to prevent this rounding? I haven't been able to find any guidance on this using a search engine, nor in the docs?
However it is being rounded to -0.1; this is a significant problem. If I do not declare MyVar as an input variable the value obviously stays as is.
What can I do to prevent this rounding? I haven't been able to find any guidance on this using a search engine, nor in the docs?
It does not round up automatically.
Either somewhere in your code, it does that and you need to fix your code or ...
... you have a cached input value, so when the Inputs dialogue box comes up, click on "Reset" to clear the cached values.
If you want to see the correct number of digits, convert it to a string with the correct/wanted accuracy.
question about decima of marketinfo() - MQL4 programming forum (2016)

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
However it is being rounded to -0.1; this is a significant problem. If I do not declare MyVar as an input variable the value obviously stays as is.
What can I do to prevent this rounding? I haven't been able to find any guidance on this using a search engine, nor in the docs?