Ranglar va fon


{ Console.OutputEncoding = System.Text.Encoding.Unicode


Download 399.72 Kb.
bet6/8
Sana18.06.2023
Hajmi399.72 Kb.
#1585499
1   2   3   4   5   6   7   8
Bog'liq
4. Kiritish Chiqarish

{

Console.OutputEncoding = System.Text.Encoding.Unicode;

Console.WriteLine("The value 99999 in various formats:");

Console.WriteLine("c format: {0:c}", 99999);

Console.WriteLine("d9 format: {0:d9}", 99999);

Console.WriteLine("f3 format: {0:f5}", 99999);

Console.WriteLine("n format: {0:n}", 99999);

Console.WriteLine("E format: {0:E}", 99999);

Console.WriteLine("e format: {0:e3}", 99999);

Console.WriteLine("X format: {0:X}", 99999);

Console.WriteLine("x format: {0:x}", 99999);

Console.WriteLine("g format: {0:g}", 99.999e+4);

}

Valyuta belgilari

static void Main(string[] args)

{

Console.OutputEncoding = System.Text.Encoding.Unicode;

Console.WriteLine("Default: {0:c}", 12345);

Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

Console.WriteLine("USA: {0:c}", 12345);

Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");

Console.WriteLine("France: {0:c}", 12345);

Thread.CurrentThread.CurrentCulture = new CultureInfo("nl");

Console.WriteLine("Netherlands: {0:c}", 12345);

Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");

Console.WriteLine("Great Britain: {0:c}", 12345);

Thread.CurrentThread.CurrentCulture = new CultureInfo("ja");

Console.WriteLine("Japan: {0:c}", 12345);

var culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();

culture.NumberFormat.CurrencySymbol = "#";

Console.WriteLine("Japan custom: {0:c}", 12345);

Console.WriteLine(string.Format(culture, "Japan custom: {0:c}", 12345));

}

Satr interpolyatsiyasi

Sintaksisi: {[,][:]}

Satr literalni interpolyatsiyalangan satr sifatida aniqlash uchun satr boshiga $ belgisi qo'yiladi.

$ belgisi va satr boshlanishini bildiruvchi " belgi orasida hech qanday qo'shimcha belgilar bo'lmasligi kerak.


Download 399.72 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling