added explanatory comment to rather uncommon way of calculating rule-of-three (dreisatz)
This commit is contained in:
		@@ -338,7 +338,7 @@ public class LoadingBar {
 | 
			
		||||
 | 
			
		||||
   private static String fillLoadingBar(long initialMinutes, long passedMinutes, boolean progressive) {
 | 
			
		||||
      BigDecimal wholePercentage = BigDecimal.valueOf(100)
 | 
			
		||||
         .multiply(BigDecimal.valueOf(passedMinutes)
 | 
			
		||||
         .multiply(BigDecimal.valueOf(passedMinutes) // kind of reverse dreisatz to avoid to have e.g. 99.9999 instead of 100 %
 | 
			
		||||
         .divide(BigDecimal.valueOf(initialMinutes), MathContext.DECIMAL64));
 | 
			
		||||
      long remainingMinutes = initialMinutes - passedMinutes;
 | 
			
		||||
      int numberOfEquals = wholePercentage.intValue();
 | 
			
		||||
 
 | 
			
		||||
@@ -119,7 +119,7 @@ public class SimpleLoadingBar {
 | 
			
		||||
 | 
			
		||||
   private static String fillLoadingBar(long initialMinutes, long passedMinutes, boolean progressive) {
 | 
			
		||||
      BigDecimal wholePercentage = BigDecimal.valueOf(100)
 | 
			
		||||
         .multiply(BigDecimal.valueOf(passedMinutes)
 | 
			
		||||
         .multiply(BigDecimal.valueOf(passedMinutes) // kind of reverse dreisatz to avoid to have e.g. 99.9999 instead of 100 %
 | 
			
		||||
         .divide(BigDecimal.valueOf(initialMinutes), MathContext.DECIMAL64));
 | 
			
		||||
      long remainingMinutes = initialMinutes - passedMinutes;
 | 
			
		||||
      int numberOfEquals = wholePercentage.intValue();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user