//+------------------------------------------------------------------+
//| スクリプトプログラム開始関数 |
//+------------------------------------------------------------------+
void OnStart()
{
//--- 変換する文字列
string str = "12345.54321";
//--- 入力文字列を実数としてdouble型の変数に変換する
double converted=StringToDouble(str);
//--- 結果の数値を小数点以下8桁まで正確に操作ログに表示する
PrintFormat("The string '%s' is converted to the real number %.8f", str, converted);
/*
結果:
The string '12345.54321' is converted to the real number 12345.54321000
*/
}
|