I have a working website, where I use this expression everywhere.
price.ToString("C")
It currently shows 2 decimal places, eg. $1.45
Now I need the website to show 4 decimal places, eg. $1.4515
Is there any easy way to change it globally?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t modify the default behavior of the format specifier, but you can do a a global search-and-replace in your project. Assuming you’re using Visual Studio, you can do a global search-and-replace (Ctrl-Shift-H) and replace
.ToString("C")with.ToString("C4").