StringToInteger
함수는 숫자의 심볼 표시가 포함된 문자열을 long(정수) 유형의 숫자로 변환.
long StringToInteger(
string value
);
|
매개변수
값
[in] 숫자를 포함하는 문자열.
값 반환
예:
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//--- 변환할 문자열
string str = "12345.54321";
//--- 입력 문자열을 숫자로 긴 유형의 변수로 변환합니다.
long converted=StringToInteger(str);
//--- 얻은 숫자를 분수 부분을 잘라서 저널에 표시합니다.
PrintFormat("The string '%s' is converted to the integer number %I64d", str, converted);
/*
result:
The string '12345.54321' is converted to the integer number 12345
*/
}
|
추가 참조
IntegerToString, Real types (double, float), Typecasting