Bug with DoubleToString
-
Hi, I used DoubleToString(trading_amount_initial,2) for making numbers like 12.11 (for example)
The problem is that numbers still in format 12.11111111111111
Sometimes they are ok, but sometimes like i wrote above. -
Does it happen in mq5?
-
Yes, I don't know why this happens. Check all, but still sometimes after compiling it works as needed, and most times - as described above.
-
I know mq5 for fxDreema is not as efficiently implementes as for mq4. Maybe it's a bug. Unfortunately I'm not a programmer so I cannot give you an answer.

-
Maybe it helps to use MathFloor in combination with the DoubleToString?
-
@roar Don't understand what do you mean ;(
All that do I need to have just 2 digits after the DOT. No like 12.19999999999 - need just 12.19 that all. -
@gsmtricks
MathFloor(12.19999999999 * 100) / 100
^^ This should return 12.19 -
@roar Cool.
Could you give me an example if 12.19999999999 have in variable named for example: RateThank you.
-
@gsmtricks Just replace it to the function:
MathFloor(Rate * 100) / 100Hope it works!