How to convert 26750 string to 26,750 format in c# [duplicate]
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
精彩评论