From 9493f09f1255e706de294d3160a9f48e4b2d122b Mon Sep 17 00:00:00 2001 From: Abdiel Kavash <19243993+AbdielKavash@users.noreply.github.com> Date: Mon, 6 May 2024 14:05:18 -0600 Subject: LSC info readout fixes. (#89) * Fix DBZ. * Add spacing between value and unit. --- src/main/java/util/Util.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java/util') 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) { -- cgit