Convert Double to String: Culture specific

前端 未结 4 924
情话喂你
情话喂你 2021-01-19 15:22

Let\'s say my method has a argument of type Double. but sometimes what I pass is an int like 7 and not a double like 7.0 , so if I use ToString method then 7 will be \"7\" ,

4条回答
  •  清歌不尽
    2021-01-19 16:00

    you need to use

    string.format

    msdn

    http://msdn.microsoft.com/en-us/library/system.string.format.aspx

    http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx

提交回复
热议问题