From the course: Visual Basic Essential Training

Unlock this course with a free trial

Join today to access over 24,500 courses taught by industry experts.

Convert numeric values

Convert numeric values

- [Instructor] In the slides, we covered most of the fundamentals of how to convert between types. Let's look at a couple of practical examples. I'm working in this conversion project. I made it the startup. Before I show you the code and do some implicit and explicit conversions, I want to talk about type properties. As I've mentioned, the VB keywords like integer and double are aliases to .net types, so because they're types, that means there are methods and properties that we can use in our code. For example, if you ever want to know the maximum allowed value for an integer or any of the other types, you can go to the max value property. Same with the minimum value. And then there's methods like is positive. So here I can pass in a number. I'll get back a true or false, whether this 10 is a positive number, or whether this 15 is an odd integer. Or on this number, how many zeros are on the end of the number? In this case, this would return two. Now that we've seen it, let's talk…

Contents