I'm working on a piece ColdFusion code to calculate the grade point average. How do I format (Round up) the GPA to one decimal place?
I tried using numberFormat but I did not get the result as expected. The GPA was being rounded to the nearest whole number. Ex. when "I have GPA 3.23, the function would round it up to 3.0, instead of 3.2.
<cfdump var = "#numberFormat(totalgpa, '.0')#">
Ex.
When I have GPA 3.23, the expected result should be 3.2;
When I have GPA 3.45, the expected result should be 3.5;
When I have GPA 3.98, the expected result should be 4.0;