J
Jack Fu
How do I format output of strings, numbers, etc. on a console? For example,
the code below produces the console output shown below it. How do I specify
the output format? For example, if I enter 45.7 for money, how do I specify
that its output will look like $45.70? Thanks in advance!
Console.WriteLine("Item ID : {0}", Inventory[x].ID);
Console.WriteLine("Description : {0}", Inventory[x].description);
Console.WriteLine("Price : {0}", Inventory[x].price);
Item ID : 305
Description : wheel bearing
Price : 59.95
the code below produces the console output shown below it. How do I specify
the output format? For example, if I enter 45.7 for money, how do I specify
that its output will look like $45.70? Thanks in advance!
Console.WriteLine("Item ID : {0}", Inventory[x].ID);
Console.WriteLine("Description : {0}", Inventory[x].description);
Console.WriteLine("Price : {0}", Inventory[x].price);
Item ID : 305
Description : wheel bearing
Price : 59.95