aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util/GTWaila.java
blob: 676335a760362ea1a4880cef995f708f66ea915b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package gregtech.api.util;

public abstract class GTWaila {

    public static String getMachineProgressString(boolean isActive, int maxProgresstime, int progresstime) {
        return getMachineProgressString(isActive, maxProgresstime, (long) progresstime);
    }

    public static String getMachineProgressString(boolean isActive, long maxProgresstime, long progresstime) {

        if (!isActive) return "Idle";

        return "In progress: " + String.format("%,.2f", (double) progresstime / 20)
            + "s / "
            + String.format("%,.2f", (double) maxProgresstime / 20)
            + "s ("
            + GTUtility.formatNumbers((Math.round((double) progresstime / maxProgresstime * 1000) / 10.0))
            + "%)";
    }
}