Euro - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Euro

doncudoncu Posts: 4Member
I use the Euro symbol as the default currency in Windows.
When I attempted to use it in C# all I get is the ? symbol.

Any ideas

Comments

  • BaldusariusBaldusarius Posts: 162Member
    In what way did you attempt to use it? I'm guessing whatever you were doing was using an encoding other than Unicode.
  • doncudoncu Posts: 4Member
    : In what way did you attempt to use it? I'm guessing whatever you were doing was using an encoding other than Unicode.
    :
    I attemped to use it using programs from the Microsoft site.
    Using the Unicode 20Ac
  • BaldusariusBaldusarius Posts: 162Member
    Only guesses can be offered unless you provide some details.
  • doncudoncu Posts: 4Member
    : Only guesses can be offered unless you provide some details.
    :
    I have tried the following program from Microsoft's site.
    using System;
    using System.Golbalizition;
    public class TestClass {
    public static void Main() {
    int = 100;
    CultureInfo x = new CultureInfo("en-IE");
    Console.WriteLine( i.ToString("c",IE))
    }
    }
    I still get ? instead of
  • BaldusariusBaldusarius Posts: 162Member
    The best way to post code samples in messageboards is to copy and paste. You can then remove the lines that are not pertinent. That avoids the situation that the person trying to offer assistance has to guess at what you meant to get your sample to even compile.

    I'm assuming that the unnamed int in your code should be "i" and that the ToString method should have been passed x (the CultureInfo object) as the second parameter instead of IE (which I have no clue about). With those changes made, the correct symbol is printed to the console.


    : : Only guesses can be offered unless you provide some details.
    : :
    : I have tried the following program from Microsoft's site.
    : using System;
    : using System.Golbalizition;
    : public class TestClass {
    : public static void Main() {
    : int = 100;
    : CultureInfo x = new CultureInfo("en-IE");
    : Console.WriteLine( i.ToString("c",IE))
    : }
    : }
    : I still get ? instead of
    :

  • doncudoncu Posts: 4Member
    : The best way to post code samples in messageboards is to copy and paste. You can then remove the lines that are not pertinent. That avoids the situation that the person trying to offer assistance has to guess at what you meant to get your sample to even compile.
    :
    : I'm assuming that the unnamed int in your code should be "i" and that the ToString method should have been passed x (the CultureInfo object) as the second parameter instead of IE (which I have no clue about). With those changes made, the correct symbol is printed to the console.
    :
    :
    : : : Only guesses can be offered unless you provide some details.
    : : :
    : : I have tried the following program from Microsoft's site.
    : : using System;
    : : using System.Golbalizition;
    : : public class TestClass {
    : : public static void Main() {
    : : int = 100;
    : : CultureInfo x = new CultureInfo("en-IE");
    : : Console.WriteLine( i.ToString("c",IE))
    : : }
    : : }
    : : I still get ? instead of
    : :
    : Sorry about the mistakes.
    The en-IE is to get the Irish Euro
    : using System;
    using System.Globalization;

    namespace Currency1
    {

    public class TestClass
    {

    public static void Main()
    {
    int i = 100;
    CultureInfo ir = new CultureInfo("en-IE");
    Console.WriteLine(i.ToString("c",ir));
    }
    }
    }

Sign In or Register to comment.