mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
neutrino: avoid float for percent calculations
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user