How to convert object to integer | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula gr√°tis
+ 1

How to convert object to integer

To insert in datatable

20th Jun 2018, 4:39 PM
Mohammed Azharuddin
Mohammed Azharuddin - avatar
5 Respostas
In javascript use parseInt(yourString); yourString should be a number string.
25th Jun 2018, 5:31 AM
ntate tiisetso
ntate tiisetso - avatar
in wich languaje do you wanna do it? I tried it in js, and you could convert a string to integer by multiplying it by 1 (in case that the string contains just numbers in it).
20th Jun 2018, 6:23 PM
Angel Daniel Méndez Díaz
Angel Daniel Méndez Díaz - avatar
in python you can surround a string like this: int(‚Äú9876‚ÄĚ) will turn it into an integer.
20th Jun 2018, 7:46 PM
just use a type cast
20th Jun 2018, 8:27 PM
hinanawi - avatar
I need information on nuclear physics
16th May 2019, 1:34 PM
Bataung Arnold Khotso Pitso