Added Grid quantity formatting for item counts over 1 billion. Fixes #2184

This commit is contained in:
raoulvdberge
2019-03-04 14:06:35 +01:00
parent 53b3c14e7f
commit cecf4927cc
2 changed files with 4 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
### 1.6.13 ### 1.6.13
- Fixed Interface with Crafting Upgrade being stuck if an earlier item configuration has missing items or fluids (raoulvdberge) - Fixed Interface with Crafting Upgrade being stuck if an earlier item configuration has missing items or fluids (raoulvdberge)
- Added keybindings to open wireless items. The default one set to open a Wireless Grid is CTRL + G (raoulvdberge) - Added keybindings to open wireless items. The default one set to open a Wireless Grid is CTRL + G (raoulvdberge)
- Added Grid quantity formatting for item counts over 1 billion (raoulvdberge)
- Updated German translation (cydhra) - Updated German translation (cydhra)
- Updated Chinese translation (KoderX) - Updated Chinese translation (KoderX)
- Fixed wrong item count for oredict patterns (the-eater) - Fixed wrong item count for oredict patterns (the-eater)

View File

@@ -25,7 +25,9 @@ public class QuantityFormatter implements IQuantityFormatter {
@Override @Override
public String formatWithUnits(long qty) { public String formatWithUnits(long qty) {
if (qty >= 1_000_000) { if (qty >= 1_000_000_000) {
return formatterWithUnits.format(Math.round((float) qty / 1_000_000_000)) + "B";
} else if (qty >= 1_000_000) {
float qtyShort = (float) qty / 1_000_000F; float qtyShort = (float) qty / 1_000_000F;
if (qty >= 100_000_000) { if (qty >= 100_000_000) {