ToString not writing 0.000

O

ORC

Hi,

Is it possible to format the ToString function so that it will write 0
instead of e.g. 0.0000 if the value is actually 0?

I use this in my code to format the string: Value.ToString("0.0000"); where
value is a double.

Thanks
Ole
 
O

ORC

OK - figured it out: I can just use this instead:
Value.ToString("0.####"); - great feature!

Ole
 
M

Maqsood Ahmed

You can use value.ToString("#,0.000");
it formats your double value to three decimal places and also puts a
comma after each thousand value.

Maqsood Ahmed
Kolachi Advanced Technologies
http://www.kolachi.net
 

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

Similar Threads


Top