Skip to content

Commit 3cf0134

Browse files
committed
format amount crafted better
1 parent c6e68f3 commit 3cf0134

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityWorkbench.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import gregtech.api.mui.GTGuis;
1010
import gregtech.api.mui.sync.PagedWidgetSyncHandler;
1111
import gregtech.api.util.GTUtility;
12+
import gregtech.api.util.TextFormattingUtil;
1213
import gregtech.client.renderer.texture.Textures;
1314
import gregtech.common.inventory.handlers.SingleItemStackHandler;
1415
import gregtech.common.inventory.handlers.ToolItemStackHandler;
@@ -332,8 +333,14 @@ public IWidget createCraftingOutput(PosGuiData guiData, PanelSyncManager syncMan
332333
.marginTop(18)
333334
.background(GTGuiTextures.SLOT.asIcon().size(22))
334335
.marginBottom(4))
335-
.child(IKey.dynamic(amountCrafted::getStringValue)
336-
.alignment(Alignment.Center)
336+
.child(IKey.dynamic(() -> {
337+
int amount = amountCrafted.getIntValue();
338+
if (amount > 1000) {
339+
return TextFormattingUtil.formatLongToCompactString(amount);
340+
} else {
341+
return TextFormattingUtil.formatNumbers(amount);
342+
}
343+
}).alignment(Alignment.Center)
337344
.asWidget().widthRel(1f));
338345
}
339346

0 commit comments

Comments
 (0)