开发者

C# Double.ToString() [duplicate]

This question already has answers here: 开发者_运维百科 Closed 12 years ago.

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


Hope this will work.

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜