mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-06-26 01:00:25 +00:00
Fix invalid charge error when using suffix currency on signs (#3253)
i swear i test my code Fixes #3252.
This commit is contained in:
parent
fc2b7b63a2
commit
61d0ed3f01
4 changed files with 19 additions and 10 deletions
|
@ -88,6 +88,15 @@ public class NumberUtil {
|
|||
return sign + tl("currency", ess.getSettings().getCurrencySymbol(), currency);
|
||||
}
|
||||
|
||||
public static String sanitizeCurrencyString(final String input, final IEssentials ess) {
|
||||
String symbol = ess.getSettings().getCurrencySymbol();
|
||||
boolean suffix = ess.getSettings().isCurrencySymbolSuffixed();
|
||||
if (input.contains(symbol)) {
|
||||
return suffix ? input.substring(0, input.indexOf(symbol)) : input.substring(symbol.length());
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
public static boolean isInt(final String sInt) {
|
||||
try {
|
||||
Integer.parseInt(sInt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue