Download MetaTrader 5

More Elegant Way to Format Output?

To add comments, please log in or register
No PC at hand? Communicate with friends using your mobile phone!
Carl Schreiber
6588
Carl Schreiber 2015.10.29 11:17 

We now have in mql4 a way to formate the output with a variable number of digits:

...
   string fmt = StringFormat("%%.%df",digs),
   Comment(StringFormat("Var1: %s  Var2: %s ...",
            StringFormat(fmt,var1),StringFormat(fmt,var2), ...);

Is there a way that I need only one StringFormat instead of at least one for each variable to be shown?

Alain Verleyen
Moderator
30722
Alain Verleyen 2015.10.29 18:15  
calli:

We now have in mql4 a way to formate the output with a variable number of digits:

Is there a way that I need only one StringFormat instead of at least one for each variable to be shown?

Unfortunately not, as Metaquotes doesn't implemented the complete specs as in C++ apparently.

Carl Schreiber
6588
Carl Schreiber 2015.10.29 20:29  

hmm :(

Anyway thanks!

To add comments, please log in or register