ToString not writing 0.000

  • Thread starter Thread starter ORC
  • Start date Start date
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
 
OK - figured it out: I can just use this instead:
Value.ToString("0.####"); - great feature!

Ole
 
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
 
Back
Top