1

I'm trying to change the cultureinfo of my program from the default en-US to it-IT:

decimal x = 12000; 
            Console.WriteLine("The current culture is {0}", Thread.CurrentThread.CurrentCulture.Name);
            Console.WriteLine("currency: {0:C}", x);
            Thread.CurrentThread.CurrentCulture = new CultureInfo("it-IT");
            Console.WriteLine("The culture changed in {0}", Thread.CurrentThread.CurrentCulture.Name);
            Console.WriteLine("currency: {0:C}", x);
            Console.ReadLine();

The output is: capture

Instead of the question mark, there should be €. What am I doing wrong?

Community
  • 1
  • 1
LittleHi
  • 17
  • 5
  • 1
    `Console.OutputEncoding = Encoding.Unicode;` – user4003407 Dec 30 '17 at 07:52
  • 2
    For future reference, when getting incorrect output, one of the very first things you should do is debug the problem and determine whether the source text being output is correct (i.e. figure out whether it's the data that's the problem, or the visual representation of the data). Had you done that, you'd have seen that the string itself contained the expected character, and that your question has absolutely nothing to do with a failure to change the culture. – Peter Duniho Dec 30 '17 at 07:56
  • 1
    Also, there's really no reason to post an _image_ when sharing the output of a _console_ program. The console program's output is plain text, and so can and should be included in your post exactly that way (you can use `
    ` to have the text shown without any code formatting, but with a fixed-space font appropriate to console output).
    – Peter Duniho Dec 30 '17 at 07:57

0 Answers0