Console.WriteLine("{0:###,###.##}", 123456.56); .
123,456.56
, , .
decimal balance; balance = 12323.09m;
Console.WriteLine(" {0:C}", balance);
, .
$12,323.0 9
, .
// // .
Using System;
class UseDecimal { static void Main() { decimal price; decimal discount; decimal discounted_price;
// , price = 19.95m;
discount = 0.15m; // 15% discounted_price = price - (price * discount);
Console.WriteLine(" : {0:C}", discounted_price);
}
}
.
: 16,96 .
C# , . , 100 . , . .
C# . . , . , 1 1 1 % 1 .
. , 10 -100 . . ,
11.123 . C# .
, C# . : , 2, 123987 0. 23? , C# .
-, , , int. , : int, uint, long ulong . -, double.
, . , long 1 L. , 12 int, al2L long. U. , 100 int, a 100U uint. ul UL. , 984375UL ulong.
|
|
, float F f. , 10.19F float. double, d D, . , , double.
, decimal m . , 9. 95 decimal.
int, uint, long ulong, byte, sbyte, short ushort, , .
, , , 16, 10. 16 . 0 9, F, 10,11,12,13, 14 15. , 16 10. , C# . , .. "". .
count = OxFF; // 255 incr = 0x1; // 26
, , , . , , , #, . C# , (. 3.2). , .'
3.2.
\a
()
\b
\f
( )
\n
( )
\r
\t
\v
\0
V
\"
w