Brett

Brett

  • NA
  • 3
  • 14.6k

Format String Question

Aug 24 2010 8:22 PM
I am pulling the values from a database using a Querystring.

Example values:
1.1
2.1
10.1
11.1

Is there a way to format the string so that it onlys shows the numbers before the decimal point?
Ex. 1.1 = 1, 10.1 = 10, etc.

I tried the code below but it only shows the first number.

string strNumber = Request.QueryString["Number"];

string strCode = strNumber.Substring(0,1);
this.Label1.Text = strCode.ToString();

Answers (2)