3

Is there a setting to change the default decimal separator (',' to '.') for float/double/decimal in VC 2017?

Right now i have to copy-paste this into every project:

System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
customCulture.NumberFormat.NumberDecimalSeparator = ".";
System.Threading.Thread.CurrentThread.CurrentCulture = customCulture;

EDIT: Okay, figured this one out thanks to Tim. This setting is OS based, therefore you have to change it in your OS settings.

For Windows you have to type "Region" into the Search box. Go to Additional Settings and change the "Decimal symbol" option.

Abbas Aryanpour
  • 391
  • 3
  • 15
Tomas Loksa
  • 95
  • 1
  • 10
  • You want to change VS behavior or in your app? – BWA Jul 13 '17 at 09:59
  • VS behavior. Thought it would be somewhere in Tools --> Options, but i can't find it in there. – Tomas Loksa Jul 13 '17 at 10:21
  • 1
    Possible duplicate of [How to change symbol for decimal point in double.ToString()?](https://stackoverflow.com/questions/3135569/how-to-change-symbol-for-decimal-point-in-double-tostring) – Abob May 03 '19 at 18:11

0 Answers0