I use Windows 7, Visual Studio 2013, C # and .NET 4.5.
My problem is the output of the line given below:
console. WrightLine ("Car's value: {0: C}", myNewCar.determineMarketValue ());
myNewCar.determineMarketValue ()
returns a double.
How can I fix this problem?
My output is:
Using the system; Using System.Collections.Generic; Using System.Linq; Using System.Text; System usage threading. Task; Namespace Lesson 15 Simple Classes {Class Program {Static Wide Men (String [] AGR) {Car MyNew Car = New Car; MyNewCar.Make = "OldSmobile"; MyNewCar.Model = "Cutlus Supreme"; MyNewCar.Year = 1986; MyNewCar.Color = "Silver"; Console Output Encoding = SystemText.Nencoding.unicode; Console.light line ("{0} - {1} - {2}", My Newker.Make, MyEncar.model, Minwkar.console.lightline ("Car's value: {0: c}", myNewCar.determineMarketValue ( ); Console.ReadLine ();}} class car {make public string {get};} public string model {get; set;} public int year {receive; set;} public string color {get; set;} Determine Public Double Market Price () {Double Car Value = 100.0; if (this.Year> 1990) Car Value = 10000.0; Second Car Value = 2000.0; (Car Value);}}}
I added my code ... and have simple yet work: (
Update: code to Console.optput encoding = SystemText is updated to use .Encoding.Unicode;
and my currency and console settings are also shown below:
You can see that the problem is that even though I use my code to use Unicode Dated, whenever I execute the program from VS, my CMD settings are changed to use the Lucid console font. / P>
Last Editing: How fast and simple to use console fonts used by the Visual Studio Console Now the currency in my program looks correct:
It is according to the design.
The .NET Console application uses some predefined system fonts (usually text using the Leucida console, but it can be a console or another similar font).
This font is not required for your currency, so S Ymbol can be displayed incorrectly. Look for the symbols of the currencies supported in the Lucida Console.
You can not fix it easily in the console because changing the font used to display the text in the console is not so easy (this is possible with some WinAPI calls, I think) .
No comments:
Post a Comment