Entry lots value

 
Good morning,

Has anyone noticed and entry lots value being something like .230000000004 in MT5 when you put it as .23 in the code? Is there a way to correct this?
 
willy850a:
Good morning,

Has anyone noticed and entry lots value being something like .230000000004 in MT5 when you put it as .23 in the code? Is there a way to correct this?

This has been already reported.

https://www.mql5.com/en/forum/387082#comment_27386417

 
willy850a: Has anyone noticed and entry lots value being something like .230000000004 in MT5 when you put it as .23 in the code? Is there a way to correct this?

The latest release MT5 build has a display problem with showing too many decimal digits. However, internally it is working just as before. The reason you see a "strange" rounding is because that is how floating point numbers work and it has been like that since the beginning in all other computer programs, not just MetaTrader. You did not see it before because it was showing less digits.

Do some research here on the forum and on the web about how floating point number are represented in binary.

 

Floating-point has an infinite number of decimals, it's you, not understanding floating-point and that some numbers can't be represented exactly. (like 1/10.)
          Double-precision floating-point format - Wikipedia

See also The == operand. - MQL4 programming forum (2013)

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)

 
Fernando Carreiro #:

The latest release MT5 build has a display problem with showing too many decimal digits. However, internally it is working just as before. The reason you see a "strange" rounding is because that is how floating point numbers work and it has been like that since the beginning in all other computer programs, not just MetaTrader. You did not see it before because it was showing less digits.

Do some research here on the forum and on the web about how floating point number are represented in binary.

Thank you for the explanation. 
 
Eleni Anna Branou #:

This has been already reported.

https://www.mql5.com/en/forum/387082#comment_27386417

Is it an appropriate assumption that this will be changed back to its former state?
 
willy850a #:
Is it an appropriate assumption that this will be changed back to its former state?

I know what you know.

Reason: