Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Saturday, February 25, 2017 10:43 AM
Hey guys sorry for asking but i am rather new to visual studios and for some reason all my decimals are shown as ',' instead of '.' how do i change this. i have looked but i cant see how to change it. I'd like it to display a number as 2.5 and not 2,5, i also have to input a comma for a decimal or else it crashes. how can i change this please help.
thanks
All replies (5)
Saturday, February 25, 2017 8:46 PM
for some reason all my decimals are shown as ',' instead of '.' how do i change this. i have looked but i cant see how to change it. I'd like it to display a number as 2.5 and not 2,5, i also have to input a comma for a decimal or else it crashes.
That is usually a result of locale settings being used which either define
the separator as a comma or define the geographical region (e.g. - country)
as one which uses the comma by default. (Such as France.)
You need to provide a little more information.
Is this just happening in programs that you create?
Or does it happen in all programs that you run?
Is it happening in the IDE editor as well? (In your *source* code?)
What is the locale (country) settings for the operating system on the
computer you're using?
- Wayne
Wednesday, March 1, 2017 5:59 AM
Hi,
Thank you for posting here.
I try to test your issue on my operating system. My default local setting is Chinese.
unfortunately, I cannot reproduce your issue.
If you have free time, I hope you can provide a reproducing demo for us.
Your cooperate is important. one driver is good place where you can upload your demo.
Best Regards,
Hart
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].
Wednesday, March 1, 2017 11:45 AM
Hi,
Probably causing for regional settings. I am moving your thread to Visual Studio General forum for getting quick response.
Your understanding and cooperation will be grateful.
Thanks,
Sabah Shariq
[If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]
Wednesday, March 1, 2017 12:03 PM
Maybe you can try something like :
var culture = System.Globalization.CultureInfo.InvariantCulture;
decimal dec = Decimal.Parse("1.25", culture);
textBox1.Text = dec.ToString();
This displays "." although my regional settings have ","
Thursday, March 2, 2017 1:59 AM
Hi Connydom,
Please reset your VS to see again:
Tools->Import and Export Settings->Reset all settings->No->Visual C#->Finish
Sincerely,
Oscar
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].