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

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
You need one
so that
the result was: 4
Exactly four? Let's do it.
Perhaps that is exactly the function you need. Answered the TC
He needs precisely such a function, because (as you correctly noted) not all numbers can be exactly represented as double, which means that solving the problem without specifying the accuracy is meaningless (because in the general case it leads to absurd results).
He needs exactly that, because (as you correctly noted) not all numbers can be accurately represented as a double, which means that solving the problem without specifying the accuracy is meaningless (because in general it leads to absurd results).
What are the options for specifying accuracy without changing the number of decimal places, or how can I eliminate the disadvantage I described in my version? For myself I found only (string)value
What are the options for specifying accuracy without changing the number of decimal places, or how can I eliminate the disadvantage I described in my version? For myself I found only (string)value
I guess you mean within what limits to look for the last non-zero.
I tried to do a calculation of the number of decimal places through MathMod() with a consecutive divisor 0.1, then 0.01 ... 0.000(15 zeros) 1, it did not work, the accuracy of the number keeps "floating" need to normalize each time, and if you use normalization, then it is easier to compare the number you want and normalized to what sign - if different, then found the last sign
HH: there is another option, did not have time to check - multiply a real number without an integer part of 10 ^ 16 and save it all in long, and then divide by 10 and check the remainder of the division, if = 0, then again divide
ZS: there is another option, I have not had time to check - multiply a real number without an integer part by 10^16 and save it all in long, and then divide by 10 and check the remainder of the division, if = 0, then divide again
It won't work.
UsedoublePoint()
Also tested, no way.
That's it.
It gives this result
Also tested, it won't work.