diff options
| author | Cow <cow@volloeko.de> | 2021-04-11 15:03:58 +0200 |
|---|---|---|
| committer | Cow <cow@volloeko.de> | 2021-04-11 15:03:58 +0200 |
| commit | cc2b9c92404ed03661778aaae5477444a146ee9f (patch) | |
| tree | 2ba05b5f47a2cd2a93e9c93e9461f1e4f3f81892 /src/main/java/de/cowtipper/cowlection/util | |
| parent | a3f2cd8c51179c54661751525ae02249d0341934 (diff) | |
| download | Cowlection-cc2b9c92404ed03661778aaae5477444a146ee9f.tar.gz Cowlection-cc2b9c92404ed03661778aaae5477444a146ee9f.tar.bz2 Cowlection-cc2b9c92404ed03661778aaae5477444a146ee9f.zip | |
Added order (sort) functionality to Bazaar 'Sell All' tooltip
- also increased decimal places for AH: price each
- also added Bestiary Overview mini-'tutorial'
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/util')
| -rw-r--r-- | src/main/java/de/cowtipper/cowlection/util/Utils.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/util/Utils.java b/src/main/java/de/cowtipper/cowlection/util/Utils.java index bfeef4b..47eb356 100644 --- a/src/main/java/de/cowtipper/cowlection/util/Utils.java +++ b/src/main/java/de/cowtipper/cowlection/util/Utils.java @@ -121,7 +121,18 @@ public final class Utils { Double divideBy = e.getKey(); Character suffix = e.getValue(); - DecimalFormat df = new DecimalFormat("#,##0.#"); + String amountOfDecimals; + switch (suffix) { + case 'k': + amountOfDecimals = "#"; + break; + case 'm': + amountOfDecimals = "##"; + break; + default: + amountOfDecimals = "###"; + } + DecimalFormat df = new DecimalFormat("#,##0." + amountOfDecimals); return df.format(number / divideBy) + suffix; } |
