mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
Tidy up number formating
This commit is contained in:
@@ -9,10 +9,8 @@ import redone.util.GameLogger;
|
|||||||
import redone.util.Misc;
|
import redone.util.Misc;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.text.DecimalFormat;
|
||||||
import java.util.Random;
|
import java.util.*;
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
|
|
||||||
import static redone.game.players.PlayerSave.loadPlayerInfo;
|
import static redone.game.players.PlayerSave.loadPlayerInfo;
|
||||||
|
|
||||||
@@ -85,12 +83,13 @@ public class Bot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String formatSellPrice(int price) {
|
private String formatSellPrice(int price) {
|
||||||
if (price > 1e9) {
|
DecimalFormat df = new DecimalFormat("#.##");
|
||||||
return (Math.floor(price / 1e8) / 10) + "B";
|
if (price >= 1e9) {
|
||||||
} else if (price > 1e6) {
|
return df.format(Math.floor(price / 1e8) / 10) + "B";
|
||||||
return (Math.floor(price / 1e5) / 10) + "M";
|
} else if (price >= 1e6) {
|
||||||
} else if (price > 1e3) {
|
return df.format(Math.floor(price / 1e5) / 10) + "M";
|
||||||
return (Math.floor(price / 100) / 10) + "K";
|
} else if (price >= 1e3) {
|
||||||
|
return df.format(Math.floor(price / 100) / 10) + "K";
|
||||||
} else {
|
} else {
|
||||||
return "" + price;
|
return "" + price;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user