jeudi 1 janvier 2015

convert String to Currency in C Sharp


I am trying to take the string input of TR and string PMP convert them into currency then multiply together to get an output in USD currency .



string SP; // Sales Price

string TR; //Total Revenue

string PMP; //Property management percentage

string PMF; //Property Management Monthly Fee


Console.WriteLine("What is the total rent revenue?");
TR = Console.ReadLine();
Console.WriteLine("what is the percentage you pay to property managment?");
PMP = Console.ReadLine();
Console.WriteLine("you will be buying {0}", PMF );


SP = Console.ReadLine();
TR = Console.ReadLine();
PMP = Console.ReadLine();
PMF = string.Format("{TR:C,PMP:C}") <------- THIS IS WHERE I AM TRYING TO CONVERT AND MULTIPLY****


Any help will be grateful. Thank you


PS I am not a programmer by trade (mostly Networking Engineering and Server Admin), This is my first 20 hours into programming.





Aucun commentaire:

Enregistrer un commentaire