Answered by:
Prefix

Question
-
User1539018121 posted
Hey,
I have to calculate a figure and have it display in a lable on my web page - which I have written the code for and it all works fine.
I just am unsure on how I get a $ to show up in front of the figure that shows in the label, as it a dollar amount.
Any help would be appreciated!
Thanks :)
Wednesday, September 4, 2013 4:30 AM
Answers
-
User-1360095595 posted
string.Format("{0:$#,###.00}", 1000);
That's one way.
Edit: here's another:
string.Format("{0:C}", 563772.50)
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, September 4, 2013 4:35 AM -
User-1716253493 posted
Try this
totalRevenueLabel.Text = totalRevenueDecimal.ToString("$#,###.00");
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, September 4, 2013 4:57 AM
All replies
-
User-1360095595 posted
string.Format("{0:$#,###.00}", 1000);
That's one way.
Edit: here's another:
string.Format("{0:C}", 563772.50)
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, September 4, 2013 4:35 AM -
User1539018121 posted
Thanks, where do I put that if my code is:
totalRevenueLabel.Text = totalRevenueDecimal.ToString();
Wednesday, September 4, 2013 4:49 AM -
User-1716253493 posted
Try this
totalRevenueLabel.Text = totalRevenueDecimal.ToString("$#,###.00");
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, September 4, 2013 4:57 AM