Download presentation
Presentation is loading. Please wait.
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.