Hello,
I'm trying to use following code to calculate percentage and then calculated percentage will be compared with a grading criteria to determine grades of students.
Problem is, if a percentage is 39.5, it is compared with criteria which is if lngPercentage is less than 40 then it should assign grade F but percentage is rounded off to 40 and it assign grade pass and same is for other grades. I want the calculated percentage value to have one digit after the decimal sign but it behaving like an integer. How can I resolve the issue.
Best Regards,
Abdullah
I'm trying to use following code to calculate percentage and then calculated percentage will be compared with a grading criteria to determine grades of students.
Code:
Dim lngPercentage As Single
lngPercentage = (cMarksObtaind * 100) / cMaximumMarks
Problem is, if a percentage is 39.5, it is compared with criteria which is if lngPercentage is less than 40 then it should assign grade F but percentage is rounded off to 40 and it assign grade pass and same is for other grades. I want the calculated percentage value to have one digit after the decimal sign but it behaving like an integer. How can I resolve the issue.
Best Regards,
Abdullah