+ 1

when should I use .toint16, .toint32 and .toint64?

15th Aug 2016, 11:15 PM
Aero Purity
Aero Purity - avatar
3 Answers
+ 6
When you want to convert something to integer datatype. If it's not a very big number use toint16 so you'll keep the memory usage at minimum. But if it's big use the others.
16th Aug 2016, 2:41 PM
Alireza M
Alireza M - avatar
+ 2
It depends on variable datatype which will store your parsed number. ToInt16 will return Int16 datatype value(16 bit number, also called "short"), ToInt32 will return Int32 datatype value (32 bit number, also called "int"), ToInt64 will return Int64 datatype value (64 bit number, also called "long"). If you don't know which format you need, then use Int32. If you parse big numbers (more than 2 billions), then use Int64. In some exotic cases use Int16, of course. There are unsigned variants of these data types (UInt16, UInt32, UInt64). They have convert methods too.
18th Aug 2016, 10:14 PM
Ivan G
Ivan G - avatar
- 1
when you want to use regular numbers. but the difference is that toint16 contain less numbers than toint32 and the same with to int32 and toint64.
16th Aug 2016, 10:06 PM
Erioluwa Soyemi