use double instead of int and multiply by 100

This commit is contained in:
Paddyk45 2025-04-11 22:20:44 +02:00 committed by freq-mod
parent 2ea7bf65ea
commit 1430749ea6

View file

@ -887,9 +887,9 @@ void FurnaceGUI::drawChanOsc() {
case 'V': { case 'V': {
DivChannelState* chanState=e->getChanState(ch); DivChannelState* chanState=e->getChanState(ch);
if (chanState==NULL) break; if (chanState==NULL) break;
int volMax=chanState->volMax>>8; double volMax=chanState->volMax>>8;
if (volMax<1) volMax=1; if (volMax<1) volMax=1;
text+=fmt::sprintf("%d%%",(chanState->volume>>8)/volMax); text+=fmt::sprintf("%.1f%%",((double)(chanState->volume>>8)/volMax)*100);
break; break;
} }
case 'b': { case 'b': {