Wednesday, January 26, 2011

Converting an integer into a decimal and vice versa

This is a simple way to convert an integer into a decimal.
This is also a simple way of converting a decimal into an integer
 Dim GPA As Decimal
  
 GPA.Text = CInt(GPA)
  

 Dim myAge As Integer
  
 myAge.Text = CDec(myAge)
  

1 comment:

  1. I would have liked to see a value set to these variables. Like Dim myAge as Integer = 23.

    ReplyDelete