C # question

  • From: "Celia Rodriguez" <celia-rodriguez@xxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Sun, 6 Dec 2009 04:02:56 -0000

HiVarun

 

How do I display a decimal integer into a text box or label?

 

Here is my simple code:

 

Decimal TotalCost = 0;

 

TotalCost+=2.00M; 

 

I want to display TotalCost  as $ 2.00 in 

,Either 

lblTotal.Text or

TxtTotal.Text 

But I keep getting the following error.

Error  1              Cannot implicitly convert type 'decimal' to 'string'


Also how do I convert 2.00 as $ 2.00?

 

Thank You,

Celia

Other related posts: