Download MetaTrader 5

Include % Sign within a string type variable through StringFormat() Function

To add comments, please log in or register
vivs
48
vivs 2015.06.11 06:24 

How can I include % in StringFormat() function?

I was trying this instruction to display % sign after the stopOut value:

string msg = StringFormat("\nA/C Stop-Out: %g %",stopOut);

But, this instruction is not displaying any result.  

Alain Verleyen
Moderator
31138
Alain Verleyen 2015.06.11 07:12  
%%
vivs
48
vivs 2015.06.11 08:11  
Thanks :)
whroeder1
14753
whroeder1 2015.06.11 10:40  
Vivs: How can I include % in StringFormat() function?
If you read the documentation, PrintFormat - MQL4 Documentation just above the flags section, it says:
If you need to output the percent sign in the format string, use the format specification %%.
To add comments, please log in or register