Formatting currency values
class MainClass
{
public static void Main(){
//
decimal myMoney = 15123.45m;
System.Console.WriteLine("myMoney using 10:c2 = {0, 10:c2}",myMoney);
}
}
Output myMoney using 10:c2 = $15,123.45
|
HTML code for linking to this page:
|