Have you tried ..
NormalizeDouble()
?
In my case NormalizeDouble() seen to change nothing.
//+------------------------------------------------------------------+ //| TestPrintFormat.mq4 | //| Copyright 2014, Pierre8r | //| https://www.mql4.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2014, Pierre8r" #property link "https://www.mql4.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- PrintFormat("Time:%s Close:%f ",TimeToString(Time[0]), NormalizeDouble(Close[0],2)); } //+------------------------------------------------------------------+
Give :
2014.04.29 15:53:41.868 TestPrintFormat GOLD,Weekly: Time:2014.04.27 00:00 Close:1298.050000
Not PrintFormat, just Print
%.2f
Hi qjol,
Thanks.
Works.
//+------------------------------------------------------------------+ //| TestPrintFormat.mq4 | //| Copyright 2014, Pierre8r | //| https://www.mql4.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2014, Pierre8r" #property link "https://www.mql4.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- PrintFormat("Time:%s Close:%.2f ",TimeToString(Time[0]),Close[0]); } //+------------------------------------------------------------------+
2014.04.29 16:35:01.749 TestPrintFormat GOLD,Weekly: Time:2014.04.27 00:00 Close:1298.05
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
PrintFormat No more than 2 decimal.
With this script :
I got this :
How to have this ?