diff options
| author | Abdiel Kavash <19243993+AbdielKavash@users.noreply.github.com> | 2024-05-06 14:05:18 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-06 22:05:18 +0200 |
| commit | 9493f09f1255e706de294d3160a9f48e4b2d122b (patch) | |
| tree | b9e28679ac9095107cb8c0e65cf48bad3745850d /src/main/java/util | |
| parent | 59a09c23eff3d3bba9577eececf45a6fd3deb022 (diff) | |
| download | GT5-Unofficial-9493f09f1255e706de294d3160a9f48e4b2d122b.tar.gz GT5-Unofficial-9493f09f1255e706de294d3160a9f48e4b2d122b.tar.bz2 GT5-Unofficial-9493f09f1255e706de294d3160a9f48e4b2d122b.zip | |
LSC info readout fixes. (#89)
* Fix DBZ.
* Add spacing between value and unit.
Diffstat (limited to 'src/main/java/util')
| -rw-r--r-- | src/main/java/util/Util.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/util/Util.java b/src/main/java/util/Util.java index 17bcf2b841..2ad6dd7a9c 100644 --- a/src/main/java/util/Util.java +++ b/src/main/java/util/Util.java @@ -68,6 +68,9 @@ public class Util { /* If the number is less than 1, we round by the 6, otherwise to 2 */ public static String toPercentageFrom(BigInteger value, BigInteger maxValue) { + if (BigInteger.ZERO.equals(maxValue)) { + return "0.00%"; + } BigDecimal result = new BigDecimal(value).setScale(6, RoundingMode.HALF_UP) .divide(new BigDecimal(maxValue), RoundingMode.HALF_UP); if (result.compareTo(Threshold_1) < 0) { |
