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

Popular posts from this blog

javascript - How to bind ViewModel Store to View? -

recursion - Can every recursive algorithm be improved with dynamic programming? -

c - Why does alarm() cause fgets() to stop waiting? -