cast long string to number using parseInt in javascript? -
i want cast id 59aa94878d08a20758deed83
number, first tried without argument, got 59.
var x=parseint('59aa94878d08a20758deed83', 24); console.log(x);
above won't return 59aa94878d08a20758deed83 in number?
just use correct radix. if real hexadecimal number, use radix 16, not 24...
console.log(parseint('59aa94878d08a20758deed83', 16))
Comments
Post a Comment