StringToInteger
Conversión de una cadena que contiene la representación simbólica de un número al número del tipo long (entero).
long StringToInteger( string value ); |
Parámetros
value
[in] Cadena que contiene el número.
Valor devuelto
Ejemplo:
//+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- string to convert string str = "12345.54321"; //--- convertimos la cadena de entrada como un número en una variable de tipo long long converted=StringToInteger(str); //--- mostramos el número resultante en el registro con la parte fraccionaria cortada PrintFormat("The string '%s' is converted to the integer number %I64d", str, converted); /* resultado: The string '12345.54321' is converted to the integer number 12345 */ } |
Véase también
IntegerToString, Tipos reales (double, float), Conversión de tipos