fix truncation not always happening correctly

This commit is contained in:
Glenn Maynard
2005-03-19 11:29:08 +00:00
parent 92f067dbd2
commit 30d3c72cc0
+1 -1
View File
@@ -96,7 +96,7 @@ void PercentageDisplay::Refresh()
{
// TRICKY: printf will round, but we want to truncate. Otherwise, we may display a percent
// score that's too high and doesn't match up with the calculated grade.
float fTruncInterval = powf(0.1f, (float) PERCENT_TOTAL_SIZE);
float fTruncInterval = powf(0.1f, (float) PERCENT_TOTAL_SIZE-1);
fPercentDancePoints = ftruncf( fPercentDancePoints, fTruncInterval );
sNumToDisplay = ssprintf( "%*.*f%%", (int) PERCENT_TOTAL_SIZE, (int) PERCENT_DECIMAL_PLACES, fPercentDancePoints*100 );