fix rounding error in displaying percent score
This commit is contained in:
@@ -197,14 +197,13 @@ Grade StageStats::GetGrade( PlayerNumber pn ) const
|
||||
|
||||
LOG->Trace( "GetGrade: Actual: %f, Possible: %f", Actual, Possible );
|
||||
|
||||
#define ROUNDING_ERROR 0.00001f
|
||||
Grade grade = GRADE_FAILED;
|
||||
|
||||
float fPercent = (Possible == 0) ? 0 : Actual / Possible;
|
||||
|
||||
FOREACH_Grade(g)
|
||||
{
|
||||
if( fPercent >= PREFSMAN->m_fGradePercent[g]-ROUNDING_ERROR )
|
||||
if( fPercent >= PREFSMAN->m_fGradePercent[g] )
|
||||
{
|
||||
grade = g;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user