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      // dizgi
   );

Parametreler

value

[in]  Bir sayıyı içeren dizgi.

Dönüş değeri

long tipli değer.

 

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"strconverted);
   /*
   result:
   The string '12345.54321is converted to the integer number 12345
   */
  }

Ayrıca Bakınız

IntegerToString, Reel tipler (double, float), Tiplerin dönüşümü