Fix ProgressBar percentage displaying (#2609)

Instead of trying to display floored and rounded ratio as percentage,
multiply it by 100 to not always show 0.
This commit is contained in:
Hashes
2018-05-11 13:26:07 -04:00
committed by Tomas Slusny
parent 06f0b8973b
commit 202d04be43

View File

@@ -68,7 +68,7 @@ public class ProgressBarComponent implements LayoutableRenderableEntity
switch (labelDisplayMode) switch (labelDisplayMode)
{ {
case PERCENTAGE: case PERCENTAGE:
textToWrite = DECIMAL_FORMAT.format(Math.floor(pc)) + "%"; textToWrite = DECIMAL_FORMAT.format(Math.floor(pc * 100d)) + "%";
break; break;
default: default:
textToWrite = DECIMAL_FORMAT2.format(Math.floor(currentValue)) + "/" + maximum; textToWrite = DECIMAL_FORMAT2.format(Math.floor(currentValue)) + "/" + maximum;