开发者

How to convert 26750 string to 26,750 format in c# [duplicate]

This question already has answers here: 开发者_运维知识库 Closed 11 years ago.

Possible Duplicate:

.NET String.Format() to add commas in thousands place for a number

Hi Guys,

I have got 26750 in my string variable, something like below:

string str = "26750";

Now before showing on page, I want it to be converted into "26,750" format using c#. This value can increase as well as decrease also according to the result, so my format should work in both the cases.

Please suggest!

EDIT:

As I have written I have got string type value in my variable, I am trying with below code, but it is not working for me.

spnMiles.InnerHtml = String.Format("{0:n}", Miles);

It is not changing to the number format.

Please suggest!


This question should answers yours:

.NET String.Format() to add commas in thousands place for a number

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜