mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-03 10:51:05 +02:00
neutrino: avoid float for percent calculations
Origin commit data
------------------
Commit: fb6633b7aa
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2011-12-25 (Sun, 25 Dec 2011)
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