TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sam Phillips
NA
11
1.4k
Calculating percentage of left over cost displaying result a
Jun 7 2019 8:31 AM
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 :( Thanks in advance.
Reply
Answers (
3
)
UI Automation, Ribbon Control and Automation Anywhere 11
want grouptext box border dashed