PrintFormat()

近日在使用PrintFormat()函数,照F1 help依葫芦画瓢,死活不能正常显示,如下代码,

double margin_call = AccountInfoDouble(ACCOUNT_MARGIN_SO_CALL); 
double stop_out    = AccountInfoDouble(ACCOUNT_MARGIN_SO_SO); 
string sp = "-------------";
//PrintFormat(sp,"MarginCall= %f, StopOut= %f",AccountInfoDouble(ACCOUNT_MARGIN_SO_CALL),stop_out); //显示不正常
//Print(sp,"---MarginCall= ",DoubleToStr(margin_call,2),unit); //DoubleToStr(margin_call,2),
//Print(sp,"---StopOut= ",DoubleToStr(stop_out,2),unit); //,DoubleToStr(stop_out,2)
 PrintFormat("%s---MarginCall= %G%s, StopOut= %G%s",sp,margin_call,unit,stop_out,unit); 
最后经大神(QQ10366684)指点,最后一句才能正常显示,理由是不能提前使用变量(如变量sp)!





本博客所有文章如无特别注明均为原创。作者:天泓评测
分享到:更多

相关推荐

发表评论

路人甲 表情
Ctrl+Enter快速提交

网友评论(0)