質問

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);  
        }                    
     }
  }

正しい解決策はありません

他のヒント

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).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top