Pergunta

I am a beginner in C#

I wrote a program to print a "Amount" of Type Decimal with format specifier C (in my case Currency is ₹ (India) )

but my output shows this

? 34567.60  

i get a ? instead of currency symbol such as a $ or (which is my currency symbol in windows 8.1)


using System;    

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            decimal amount = 34567.60m;
            Console.WriteLine("{0:C}",amount);  
        }                    
     }
  }

Nenhuma solução correta

Outras dicas

Your console font cannot print this character. Switch the font of your console to something that includes the indian currency character.

You can do this by using the console's menu and selecting properties. It's one of the tabs probably labelled "font" or something similar (sorry, don't have an English version of Windows).

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top