Download MetaTrader 5

More Elegant Way to Format Output?

To add comments, please log in or register
Carl Schreiber
7674
Carl Schreiber  

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
33800
Alain Verleyen  
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
7674
Carl Schreiber  

hmm :(

Anyway thanks!

To add comments, please log in or register