Double string.format

后端 未结 5 812
北恋
北恋 2021-01-07 18:49

I have some double values I want to convert to a string with this pattern:

0.xx or x.xx

Currently I have try this:

double.T         


        
5条回答
  •  温柔的废话
    2021-01-07 19:13

    myDouble.ToString("N2")
    

    should also work.

    Have a look at

    MSDN: Custom Numeric Format Strings

    MSDN: Standard Numeric Format Strings

提交回复
热议问题