displaying decimal number 12.00 (not 12)

  • Thread starter Thread starter Dwight
  • Start date Start date
D

Dwight

Hey all,

How can I display decimal number 12 (data comes from table field that holds
decimals) as 12.00? I've tried converting it to string, converting it to
decimal, etc... but at the time I display it (either through a messagebox or
to a text control, or to a datagrid), it'll display 12. Since I'm
displaying currency, I need it to display correctly.

Thanks in advance,
Dwight
 
Hi,

What is the type of the field, if you are using double for the currency
then you should use double.ToString("C") and it will format the double
according to the locale.


Hope this help,
 
It worked great. I had searched for some help in the Net but couldn't find
anything.
I guess I was using the wrong keywords.

Thanks.
 

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