MQL4 not interpreting formatted outputs correctly

 

I could literally scream

I'm sorry but in what universe is MQL4 seeing the following :

"+DoubleToString(0.56 * 100,0)+"%"+

as "56.00" and not "56%".

The words "sick" and "tired" do not cut it, especially when this only happens with one currency pair, and no other.

Just why?!

 
TheHonestPrussian:

I could literally scream

I'm sorry but in what universe is MQL4 seeing the following :

as "56.00" and not "56%".

The words "sick" and "tired" do not cut it, especially when this only happens with one currency pair, and no other.

Just why?!

The function DoubleToString is adding the decimals. If you want only the integer part, cast the double value to an integer instead of using DoubleToString, you can use IntegerToString.
 
Dominik Egert #:
The function DoubleToString is adding the decimals. If you want only the integer part, cast the double value to an integer instead of using DoubleToString, you can use IntegerToString.

Suddenly it's decided to omit the trailing "0". Honestly sometimes I think this thing has a mind of it's won. 

 
#property strict

void OnStart()
  {
   double a = 56.0;
   PrintFormat("a = %.0f%%", a);
  }