2
Answers

Format String Question

Brett

Brett

14y
14.6k
1
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)