Show money in a Label

  • Thread starter Thread starter Alberto
  • Start date Start date
A

Alberto

How can I show money in a label? Actully I have a decimal variable and I
want to show it to the user like if it where money. For example: 5.00 ?

Thank you
 
Alberto said:
How can I show money in a label? Actully I have a decimal variable and I
want to show it to the user like if it where money. For example: 5.00 ?

Thank you

lbl.Text = String.Format("${0:0.00}", 5.00);

Try that :)

Mythran
 
Alberto said:
How can I show money in a label? Actully I have a decimal variable and I
want to show it to the user like if it where money. For example: 5.00 ?

Thank you

int my_money = 5;
Console.WriteLine( String.Format(("{0:C}", ", my_money) );

Output will be: $5.00 (or it will automatically put any other currency sign depending on locale)


Hope it helps,
Andrey
 
Alberto,

As a global approach
\\\\
MessageBox.Show(5.0.ToString("c"));
////

I hope this helps?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top