Skip to content

Commit

Permalink
fix jdk 11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
xvik committed Sep 28, 2023
1 parent 6ad2581 commit 6448b66
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static String format(final long duration) {
boolean secs = false;
if (remain >= MILLIS_PER_SECOND) {
// if only secs, show rounded value, otherwise get rid of ms
final int secondsScale = result.isEmpty() ? 2 : 0;
final int secondsScale = result.length() == 0 ? 2 : 0;
append(result, BigDecimal.valueOf(remain)
.divide(BigDecimal.valueOf(MILLIS_PER_SECOND))
.setScale(secondsScale, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString(), "s");
Expand Down

0 comments on commit 6448b66

Please sign in to comment.