StringToDouble
이 함수는 숫자의 심볼 표시가 포함된 문자열을 double 유형의 숫자로 변환.
double StringToDouble(
string value
);
|
매개변수
값
[in] 문자열은 숫자의 심볼을 나타냄.
값 반환
예:
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
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);
/*
result:
The string '12345.54321' is converted to the real number 12345.54321000
*/
}
|
추가 참조
NormalizeDouble, Real types (double, float), Typecasting