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

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -