Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 107

 
Hello! How can I efficiently learn MQL? I'm not looking for easy ways, I just want to understand it! I'm studying Kovalev's tutorial, watching videos, trying to repeat the codes that are prescribed in it. But there are so many mistakes even when I repeat the code from the tutorial..... . I understand that I have been upgraded. I was told that this site can help me, so I am here! What should I do?
 
Maybe I'm in a hurry!
 
Alexey Kozitsyn:
Split the string by the "." delimiter.

Not a bad idea...

Alexey Viktorov:
No need to disassemble anything. Change it to string just to see the right number. You don't need to do anything for calculations.

If you want to make trouble, convert the string back to a StringToDouble() number and multiply by _Point normalized to the right number, probably _Digits

The point is, I need to decompose the string into 3 numbers, and I can't convert it into a number - it turns out to be a very large number for the language.

Here is an example of such a number

long CalcY=StringToDouble("111111111111111111");
Print ("CalcY=",CalcY);

Prints the number 111111111111111104

 
FOTOGRAF14:
Maybe I'm in a hurry!
Well, don't be in a hurry! Haste is only necessary when catching fleas ((c) army humour).
 
-Aleks-:

The thing is, you need to decompose the string into 3 numbers, but you can't convert it into a number - it turns out to be a very large number for the language.

Here is an example of such a number

long CalcY=StringToDouble("111111111111111111");
Print ("CalcY=",CalcY);

Prints the number 111111111111111104

Fairy tales...
 
Vitalie Postolache:
Tales...

Try it yourself.

long CalcY=StringToDouble("111111111111111111");
Print ("CalcY=",CalcY);

long CalcZ=StringToInteger("111111111111111111");
Print ("CalcZ=",CalcZ);

double Test=CalcZ;
Print ("Test=",Test);

 
-Aleks-:

Try it yourself.

long CalcY=StringToDouble("111111111111111111");
Print ("CalcY=",CalcY);

long CalcZ=StringToInteger("111111111111111111");
Print ("CalcZ=",CalcZ);

double Test=CalcZ;
Print ("Test=",Test);

I mean "too big a number", but the code is not correct either, if it is to be converted from format to format, then it should be:

long CalcY=(long)StringToInteger("111111111111111111");
Print ("CalcY=",IntegerToString(CalcY));

What you are complaining about there is not a big number, but a glitch in the text output.

 
Vitalie Postolache:
I mean "too big a number".
Too big a number to calculate accurately - otherwise how do you explain the error at the end of the number?
 
-Aleks-:
Too big a number to calculate accurately - otherwise how do you explain the error at the end of the number?
above added.
 
Vitalie Postolache:
above added.

So I have this probrazation - you can put a line in long, but I need double for comma calculations.

Reason: