StringToInteger
Convertit une chaîne de caractères contenant la représentation symbolique d'un nombre, vers un nombre du type long (entier).
long StringToInteger(
string value
);
|
Paramètres
value
[in] La chaîne de caractères, contenant le nombre.
Valeur de Retour
Exemple :
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//---chaîne à convertir
string str = "12345.54321";
//--- convertit la chaîne d'entrée sous forme de nombre en une variable de type long
long converted=StringToInteger(str);
//--- affiche le numéro obtenu dans le journal avec la partie fractionnaire coupée
PrintFormat("The string '%s' is converted to the integer number %I64d", str, converted);
/*
résultat :
The string '12345.54321' is converted to the integer number 12345
*/
}
|
Voir aussi
IntegerToString, Les types matériels (double, float), La conformation des types