Numeric Format Strings:C

LetterMeaning
CCurrency

using System;
using System.Text;
using System.Globalization;
class Sample
{
    public static void Main()
    {
        Console.WriteLine("{0:C}", 1.1);
        Console.WriteLine("{0:C4}", 1.1);
    }
}

The output:


$1.10
$1.1000
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.