francisthegod
Member
- Joined
- Jun 7, 2019
- Messages
- 6
- Programming Experience
- 1-3
C#:
double number;
double number1;
double result;
double.TryParse(SelectedQuoteForEditing.JobPrice, out number); double.TryParse(lblRate.Content.ToString().ToString(), out number1);
var left = Math.Round((number - number1) / number * 100, 2);
result = left;
ERGPerc.Content = result.ToString("P") + "%";
I am trying to show the percentage which is left after number1 has subtracted from number. The values I am calling contain a £ symbol and when running the code I get the result of "NaN" I guess this is to do with the £ sign as when removed code works. Anyone have any idea how I can fix this please ? I have been trying for hours with no luck