0
C# form application
by using label1. Text how to out put interger value which i entered before. ex: in C i am using %d. printf ("%d is an odd number",num); in C# how to display same thing using form application and label.
2 Respostas
+ 3
You can use String.Format() to format numbers. For example:
label1.Text = String.Format("The service costs you {0:c}", 100);
label1.Text = String.Format("The cost of {0} book(s) is {1:c}", 1, 10);
Explanation:
- 1st argument is the formatting string
- within the formatting string you see {0:c}
0 is the index of arguments to format (zero based).
c means to format the argument as currency.
- {0} means to convert 1st argument into plain string.
For more details of this you can read from:
http://azuliadesigns.com/string-formatting-examples/
+ 1
maybe: label1.Text = value.ToString();