Guida di LibreOffice 7.3
Converte una stringa o un'espressione numerica in un valore intero.
CInt (Espressione)
Integer
Espressione: espressione da convertire.
Se l'argomento è un numero, è usato come valore numerico dell'espressione.
Se l'argomento è una stringa la funzione rimuove gli spazi iniziali, quindi prova a riconoscere un numero nei caratteri successivi. Le seguenti sintassi vengono riconosciute:
Numeri decimali ( opzionalmente preceduti dal segno) che fanno uso dei separatori decimali e delle migliaia configurati per la lingua locale in LibreOffice (il separatore delle migliaia è accettato in qualsiasi posizione), facoltativamente potete usare la notazione esponenziale come "-12e+1" (nella quale un numero decimale intero, opzionalmente preceduto dal segno, posto dopo la lettera "e", "E", "d" o "D" indica la potenza di 10);
Numero ottale come "&Onnn...", dove "nnn..." dopo "&O" o "&o" è una sequenza non più lunga di 11 cifre, da 0 a 7, fino al successivo carattere non alfanumerico;
Hexadecimal numbers like "&Hnnn...", where "nnn..." after "&H" or "&h" is sequence of characters up to the next non-alphanumeric character, and must be no longer than 8 digits, from 0 to 9, A to F, or a to f.
The rest of the string is ignored. If the string is not recognized, e.g. when after trimming leading whitespace it doesn't start with plus, minus, a decimal digit, or "&", or when the sequence after "&O" is longer than 11 characters or contains an alphabetic character, the numeric value of expression is 0.
If the argument is an error, the error number is used as numeric value of the expression.
If the argument is a date, number of days since 1899-12-30 (serial date) is used as numeric value of the expression. Time is represented as fraction of a day.
After calculating the numeric value of the expression, it is rounded to the nearest integer (if needed), and if the result is not between -32768 and 32767, LibreOffice Basic reports an overflow error. Otherwise, the result is returned.