From the course: Visual Basic Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Understand numeric to numeric conversions - Visual Basic Tutorial
From the course: Visual Basic Essential Training
Understand numeric to numeric conversions
- [Instructor] The process of changing a value from one data type to another type is called a conversion. In this video, we'll look at conversion concepts for the VB built-in numeric types. To review, a variable is typed at declaration time. Once the type is set, it cannot be changed, and the variable can only hold a value of its defined type. For this discussion, we'll focus on the simpler numeric types and ignore class inheritance topics. In this example, we have the counter variable. It can only hold integer values. On line 51, assigning a integer literal is acceptable. On line 52, we attempt to assign a double floating point literal. Since the variable cannot contain a double, there must be a conversion to an integer. The red squiggle is there because I've configured Visual Basic to warn me about implicit conversions. Most details about this soon. On line 53, we used the Convert class to explicitly convert from a…
Contents
-
-
-
-
-
-
-
-
-
Work with variables and constants4m 56s
-
(Locked)
Use the Code Explorer project1m 59s
-
(Locked)
Declare a variable6m 30s
-
(Locked)
Tips to make literals pop in the editor2m 34s
-
(Locked)
Work with custom and built-in constants3m 54s
-
(Locked)
Understand variable scope5m 42s
-
(Locked)
Understand numeric to numeric conversions5m 54s
-
(Locked)
Convert numeric values5m 43s
-
(Locked)
Convert and format numbers to string6m 39s
-
(Locked)
Convert and parse string to numbers5m 59s
-
(Locked)
Work with strings7m 11s
-
(Locked)
Work with dates and times9m 21s
-
(Locked)
Challenge: Strings, dates, and parsing52s
-
(Locked)
Solution: Strings, dates, and parsing2m 5s
-
-
-
-
-
-
-
-