Nápověda LibreOffice 7.3
Převede libovolný řetězec nebo číselný výraz na celé číslo.
CInt (Výraz)
Celé číslo
Výraz: Výraz, který chcete převést.
Je-li argumentem číslo, použije se jako číselná hodnota výrazu.
If the argument is string, the function trims the leading white space; then it tries to recognize a number in following characters. The syntax below are recognized:
Decimal numbers (with optional leading sign) using decimal and group separators of locale configured in LibreOffice (group separators are accepted in any position), with optional exponential notation like "-12e+1" (where an optionally signed whole decimal number after e or E or d or D defines power of 10);
Octal numbers like "&Onnn...", where "nnn..." after "&O" or "&o" is sequence no longer than 11 digits, from 0 to 7, up to the next non-alphanumeric character;
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.
Je-li argumentem chyba, jako číselná hodnota výrazu se použije její číslo.
Je-li argumentem datum, použije se jako číselná hodnota výrazu počet dní od data 1899-12-30 (datum v číselné podobě). Čas je reprezentován jako zlomek dne.
Poté co se vypočítá číselná hodnota výrazu, se tato hodnota zaokrouhlí na nejbližší celé číslo (je-li to nutné), a pokud výsledek nespadá do rozsahu -32768 až 32767, LibreOffice Basic ohlásí chybu přetečení. V opačném případě se vrátí výsledek.