Для полноты картиныParses a string argument and returns an integer of the specified radix or base. The parseInt function is not a method associated with an object, but part of the JavaScript language itself.
Syntax
parseInt(string [,radix])
Parameter
string is a string of characters representing a value that you want to parse. radix is an integer that represents the radix of the returned value.
Example
<SCRIPT LANGUAGE="JavaScript"> document.write(parseInt("3.1416")+"<BR>"); document.write(parseInt("0x11")+"<BR>"); document.write(parseInt("FXX123", 16)+"<BR>"); document.write(parseInt("17", 8)+"<BR>"); document.write(parseInt("O55")+"<BR>"); document.write(parseInt("01101101", 2)+"<BR>"); document.write(parseInt("ungi", 2)+"<BR>"); </SCRIPT> |