neutrino: avoid float for percent calculations

This commit is contained in:
Stefan Seyfried
2011-12-25 23:19:54 +01:00
parent 37c5f7c7d3
commit fb6633b7aa
5 changed files with 10 additions and 10 deletions

View File

@@ -336,7 +336,7 @@ void CVFD::showVolume(const char vol, const bool /*perform_update*/)
ShowIcon(VFD_ICON_FRAME, true);
if ((mode == MODE_TVRADIO) && g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME]) {
int pp = (int) round((double) vol * (double) 8 / (double) 100);
int pp = (vol * 8 + 50) / 100;
if(pp > 8) pp = 8;
if(oldpp != pp) {
@@ -368,7 +368,7 @@ void CVFD::showPercentOver(const unsigned char perc, const bool /*perform_update
if(perc == 255)
pp = 0;
else
pp = (int) round((double) perc * (double) 8 / (double) 100);
pp = (perc * 8 + 50) / 100;
//printf("CVFD::showPercentOver: %d, bar %d\n", (int) perc, pp);
if(pp > 8) pp = 8;
if(pp != percentOver) {