This print for content only-size & color not accurate 7" X 9-1/4" / casebound / malloy



Download 21,46 Mb.
Pdf ko'rish
bet190/1830
Sana28.09.2021
Hajmi21,46 Mb.
#188411
1   ...   186   187   188   189   190   191   192   193   ...   1830
Bog'liq
[book] [en] Pro C# 2008 and the NET 3.5 Platform Fourth Edition

// Prints: 20, 10, 30

Console.WriteLine("{1}, {0}, {2}", 10, 20, 30);



Formatting Numerical Data

If you require more elaborate formatting for numerical data, each placeholder can optionally con-

tain various format characters. Table 3-3 shows your core formatting options.

Table 3-3.

.NET Numerical Format Characters

String Format Character

Meaning in Life

C or c


Used to format currency. By default, the flag will prefix the local cultural

symbol (a dollar sign [$] for US English).

D or d

Used to format decimal numbers. This flag may also specify the



minimum number of digits used to pad the value.

E or e


Used for exponential notation. Casing controls whether the

exponential constant is uppercase (E) or lowercase (e).

F or f

Used for fixed-point formatting. This flag may also specify the



minimum number of digits used to pad the value.

G or g


Stands for general. This character can be used to format a number to

fixed or exponential format.

N or n

Used for basic numerical formatting (with commas).



X or x

Used for hexadecimal formatting. If you use an uppercase X, your hex

format will also contain uppercase characters.

These format characters are suffixed to a given placeholder value using the colon token (e.g.,

{0:C}, {1:d}, {2:X}, and so on). To illustrate, update the Main() method to call a new helper function

named FormatNumericalData(). Implement this method to format a fixed value in a variety of ways,

for example:


Download 21,46 Mb.

Do'stlaringiz bilan baham:
1   ...   186   187   188   189   190   191   192   193   ...   1830




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

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish