+ 1
when should I use .toint16, .toint32 and .toint64?
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.
+ 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.
- 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.