//+------------------------------------------------------------------+
//| スクリプトプログラム開始関数 |
//+------------------------------------------------------------------+
void OnStart()
{
//--- 変換する文字列
string str = "12345.54321";
//--- 入力文字列を数字としてlong型の変数に変換する
long converted=StringToInteger(str);
//--- 取得した数値を小数部分を切り捨てて操作ログに表示する
PrintFormat("The string '%s' is converted to the integer number %I64d", str, converted);
/*
結果:
The string '12345.54321' is converted to the integer number 12345
*/
}
|