MT5 update [build 3180] decimal input variable bug

 

Hi,

After upgrading MT5 today 29.1.2022, there is bug for decimal input value.

When you enter decimal value for example 0.2 then it changes to 0.20000000000001.

There is also bug when you want to set 4.1 as decimal input value.




 

hi, 

same problem here.

mt5 error new build

 
Marcio Andrade #:
Hi,

Is floating point, search about floating points in C e C++ to work correct.

This is visual bug issue for users when they input decimal numbers. They think indicator or EA have bug.

 
William Roeder #:

There is no bug.

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)

MetaTrader 5 users will see this as a bug, because in previous build if you entered double value 0.1 there was no additional zeroes... 0.1000000000001

This is just something that a lot of users will complain

See this GIF:

mt5decimalbug

 
Igor Zizek #:

MetaTrader 5 users will see this as a bug, because in previous build if you entered double value 0.1 there was no additional zeroes... 0.1000000000001

This is just something that a lot of users will complain

See this GIF:


Agree, even thou we deal with the imprecisions of floating point behind the scenes, this will look like a bug to users and the previous
behavior was ideal.

 

This is strange

decimal1

 
Sugianto #:

This is strange


I think that function NormalizeDouble is not working anymore?
 
Igor Zizek #:
I think that function NormalizeDouble is not working anymore?

no, it's working. But I have too many bots to update. So I'm waiting for metaquotes fix this "strange decimal input".

 
Igor Zizek #:
I think that function NormalizeDouble is not working anymore?
Sugianto #:

no, it's working. But I have too many bots to update. So I'm waiting for metaquotes fix this "strange decimal input".

NormalizeDouble() has nothing to do with how the inputs are displayed.

 
Keith Watford # :

NormalizeDouble() has nothing to do with how the inputs are displayed.

I confirm NormalizeDouble does not work and its an official bug and must be reported to ServiceDesk
 
Dark Ryd3r #:
I confirm NormalizeDouble does not work and its an official bug and must be reported to ServiceDesk

I'm not sure but I did a simple test. The NormalizeDouble function should be working.

void OnStart()
  {
//---
      Print("Normalize double test: 0.2999999 = ", DoubleToString(NormalizeDouble(0.299999, 2), 2));
   
  }

Output: 

2022.01.30 20:30:28.360 MyTest1 (EURUSD,H1) Normalize double test: 0.2999999 = 0.30


Reason: