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 - Visual Basic Tutorial
From the course: Visual Basic Essential Training
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
-
-
-
-
-
-
-
-
(Locked)
Work with variables and constants8m 17s
-
(Locked)
Use the code explorer project3m 26s
-
(Locked)
Declare a variable5m 35s
-
(Locked)
Variables and .NET types3m 36s
-
(Locked)
Naming your variables2m 19s
-
(Locked)
Understand the variable scope: What code can access the variable4m 19s
-
How data conversion works7m 49s
-
(Locked)
Convert numeric values5m 35s
-
(Locked)
Create custom constants1m 29s
-
(Locked)
Work with built-in constants3m 36s
-
(Locked)
Work with enum values3m 45s
-
(Locked)
Create a custom enum1m 35s
-
(Locked)
-
-
-
-
-
-
-
-
-
-
-
-