tags:

views:

80

answers:

2

Using .net

To add a $ symbol for numbers I did Texbox1.Text.Format = "C"

How to add % symbol at the end of each integer to represent a string in textbox.

+6  A: 

Standard Numeric Format Strings; in particular: the Percent ("P") Format Specifier.

dtb
+3  A: 
double number = 1.2;
lbl.Text = number.ToString("P");

Produces: 120.00%

double number = 0.12;
lbl.Text = number.ToString("P");

Produces: 12.00%

So if you have a percentage already:

double number = 12;
lbl.Text = (number / 100).ToString("P");

Produces: 12.00%

Kelsey