Currency format string

hamid alaaye asked on October 14, 2014 21:20

The value is 111,111. How do we wite currency format string to show the above value. After 3 number we have a comma to read the value easily. amount is: 1111.00---> currency formating sring:{0.00} amount is: 1,111.00---->currency formating sring:????

Correct Answer

hamid alaaye answered on October 16, 2014 16:49

{0:0,0}

0 votesVote for this answer Unmark Correct answer

Recent Answers


Joshua Adams answered on October 14, 2014 22:05

Take the value and do this:

int val = 111111;
string formattedval = val.ToString("C");

formattedval will contain $111,111

0 votesVote for this answer Mark as a Correct answer

hamid alaaye answered on October 15, 2014 07:41

thanks but i use online ecommerce application-->store setting-->currencies. Can you explain how to use this sections to reach the above format? is posssible this subject with out writing code?

0 votesVote for this answer Mark as a Correct answer

hamid alaaye answered on October 15, 2014 09:37

I use {0:N3} for currency format string that solve the problem but show 3 decimal. how to hide decimal section? value=1111 currency formatting string -->{0:N3} the value shown 1,111.000 now how to disable the decimal digit?

1 votesVote for this answer Mark as a Correct answer

hamid alaaye answered on October 15, 2014 18:48

Nobody to answer me?

0 votesVote for this answer Mark as a Correct answer

hamid alaaye answered on October 16, 2014 14:32

{0:0,0} is the perfect answer.

0 votesVote for this answer Mark as a Correct answer

Joshua Adams answered on October 17, 2014 20:28

what else do you want? It seems that you already answered your question.

0 votesVote for this answer Mark as a Correct answer

hamid alaaye answered on October 18, 2014 16:11

thanks. yes I reached to correct answer.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.