views:

177

answers:

2

Possible Duplicate:
Custom numeric format string to always display the sign

To format a double to certain precision in C# I write this:

d.ToString("#0.00");

What if I want to force a the sign to appear.. e.g
+2.54 and -2.54

A: 

Hope this will work.

YourDoublenumber.ToString("+#;#");
Johnny