Get the number of decimal places of any numbers (not just quotes) bypassing Digits() in MQL4 and MQL5 - page 8

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
No, it won't work...
Oh, right, I forgot that it was made knowingly for numbers less than zero, as it was used in lot normalisation. Fixed it, now it's ok:
Result:
Oh, right, I forgot that it was made knowingly for numbers less than zero, as it was used in lot normalisation. Fixed it, now it's ok:
Result:
nope, didn't work.
double f = 122334550.00999;
Result:
2018.11.13 02:36:31.034 tst (EURUSD,M30) 1. Digit() = 3
No, it didn't work.
Oh, right, I see what's wrong. I'll fix it.
Lord, give these people's children the chance to learn physics.
Why, when parents can do without it?
First, answer yourself - why do you need to know how many digits after the decimal point? To do what?
The only proper way to use "double with digits" is to use it with some given accuracy, known in advance within the problem to be solved.
Everything else is nonsense.
I'm not even talking about the fact that the greater the value of double modulo, the less accurate it is and any algorithm (especially with string conversion, that's out of bounds) will screw up.
(especially with conversion to string, it's out of line) will fail.
these are codes for MQL, not for standard C++, it's obvious that in C++ string handling will be sluggish, in MQL built-in functions are faster than self-written functions
This is code for MQL, not for standard C++, it's obvious that in C++ string handling will be sluggish, in MQL built-in functions are faster than self-written functions
That's not what I meant. The idea to convert a duble to a string and then calculate all characters in it is just a load of crap. Whatever you do.
That's not what I was talking about at all. The idea of converting a duble to a string so that you can then count the characters in the string is a complete nonsense. No matter what you do.