Question

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

No correct solution

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top