|Home | Tutorial | Classes | Functions | QSA Workbench | Language | Qt API | QSA Articles Qt Script for Applications

[Prev: parseFloat()] [Home] [Next: startTimer()]

parseInt()

parseInt( string, optBase )

Parses the string and returns the integer that the string represents in the given base optBase, or NaN if the parse fails. If the base isn't specified, the base is determined as follows:

Leading and trailing whitespace are ignored. If the string contains a number followed by non-numeric characters, the value of the number is returned and the trailing characters ignored.

Example:

    var i = parseInt( "24" );       // i == 24
    var h = parseInt( "0xFF" );     // h == 255
    var x = parseInt( " 459xyz " ); // x == 459

See also parseFloat().

[Prev: parseFloat()] [Home] [Next: startTimer()]


Copyright © 2001-2006 TrolltechTrademarks
QSA version 1.1.5