C# form application | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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.

18th Jul 2017, 12:33 PM
Aloka Devapriya
Aloka Devapriya - avatar
2 Answers
+ 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/
18th Jul 2017, 2:03 PM
Ipang
+ 1
maybe: label1.Text = value.ToString();
18th Jul 2017, 1:09 PM
Temmie!
Temmie! - avatar