StringToInteger
Bir sayının sembol temsilini içeren bir dizgiyi, long (tamsayı) tipi bir sayıya dönüştürür.
long StringToInteger(
string value
);
|
Parametreler
value
[in] Bir sayıyı içeren dizgi.
Dönüş değeri
Example:
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//--- string to convert
string str = "12345.54321";
//--- convert the input string as a number into a long type variable
long converted=StringToInteger(str);
//--- display the obtained number in the journal with the fractional part cut off
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
*/
}
|
Ayrıca Bakınız
IntegerToString, Reel tipler (double, float), Tiplerin dönüşümü