Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ch 3 Type Conversion Yonglei Tao.

Similar presentations


Presentation on theme: "Ch 3 Type Conversion Yonglei Tao."— Presentation transcript:

1 Ch 3 Type Conversion Yonglei Tao

2 Method TryParse() Convert a string to a numeric data type
Dim sales As Decimal Decimal.TryParse ( txtSales.Text, sales ) Dim num As Integer Integer.TryParse ( txtNumber.Text, num )

3 Examples

4 Class Convert Provides methods to convert a value from one data type to another Dim rate As Double = 0.05 tax = Convert.ToDecimal ( rate ) * total lblAverage.Text = Convert.ToString ( avgScore )

5 Method ToString() Available to each variable of a numeric type

6 Option Explicit/Strict


Download ppt "Ch 3 Type Conversion Yonglei Tao."

Similar presentations


Ads by Google