aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl/gui/controllers/slider
diff options
context:
space:
mode:
authorxander <xander@isxander.dev>2022-09-01 20:23:00 +0100
committerxander <xander@isxander.dev>2022-09-01 20:23:00 +0100
commitf46fc1e9d85d555cd557eefa10e1211f9ad1ceb1 (patch)
tree123fa86dcf4f27a63f0398ca4726e5876f5d04a2 /src/main/java/dev/isxander/yacl/gui/controllers/slider
parent627c45bd6cfa7cce9e048d7681029c812a45f1cc (diff)
downloadYetAnotherConfigLib-f46fc1e9d85d555cd557eefa10e1211f9ad1ceb1.tar.gz
YetAnotherConfigLib-f46fc1e9d85d555cd557eefa10e1211f9ad1ceb1.tar.bz2
YetAnotherConfigLib-f46fc1e9d85d555cd557eefa10e1211f9ad1ceb1.zip
CI stuff
rename binding functions and format numbers with commas
Diffstat (limited to 'src/main/java/dev/isxander/yacl/gui/controllers/slider')
-rw-r--r--src/main/java/dev/isxander/yacl/gui/controllers/slider/DoubleSliderController.java2
-rw-r--r--src/main/java/dev/isxander/yacl/gui/controllers/slider/FloatSliderController.java2
-rw-r--r--src/main/java/dev/isxander/yacl/gui/controllers/slider/IntegerSliderController.java3
-rw-r--r--src/main/java/dev/isxander/yacl/gui/controllers/slider/LongSliderController.java3
4 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/dev/isxander/yacl/gui/controllers/slider/DoubleSliderController.java b/src/main/java/dev/isxander/yacl/gui/controllers/slider/DoubleSliderController.java
index 8d74ceb..ed78abd 100644
--- a/src/main/java/dev/isxander/yacl/gui/controllers/slider/DoubleSliderController.java
+++ b/src/main/java/dev/isxander/yacl/gui/controllers/slider/DoubleSliderController.java
@@ -13,7 +13,7 @@ public class DoubleSliderController implements ISliderController<Double> {
/**
* Formats doubles to two decimal places
*/
- public static final Function<Double, Text> DEFAULT_FORMATTER = value -> Text.of(String.format("%.2f", value));
+ public static final Function<Double, Text> DEFAULT_FORMATTER = value -> Text.of(String.format("%,.2f", value));
private final Option<Double> option;
diff --git a/src/main/java/dev/isxander/yacl/gui/controllers/slider/FloatSliderController.java b/src/main/java/dev/isxander/yacl/gui/controllers/slider/FloatSliderController.java
index 6f4192b..4297271 100644
--- a/src/main/java/dev/isxander/yacl/gui/controllers/slider/FloatSliderController.java
+++ b/src/main/java/dev/isxander/yacl/gui/controllers/slider/FloatSliderController.java
@@ -13,7 +13,7 @@ public class FloatSliderController implements ISliderController<Float> {
/**
* Formats floats to one decimal place
*/
- public static final Function<Float, Text> DEFAULT_FORMATTER = value -> Text.of(String.format("%.1f", value));
+ public static final Function<Float, Text> DEFAULT_FORMATTER = value -> Text.of(String.format("%,.1f", value));
private final Option<Float> option;
diff --git a/src/main/java/dev/isxander/yacl/gui/controllers/slider/IntegerSliderController.java b/src/main/java/dev/isxander/yacl/gui/controllers/slider/IntegerSliderController.java
index 0d0d7b9..38efed5 100644
--- a/src/main/java/dev/isxander/yacl/gui/controllers/slider/IntegerSliderController.java
+++ b/src/main/java/dev/isxander/yacl/gui/controllers/slider/IntegerSliderController.java
@@ -1,7 +1,6 @@
package dev.isxander.yacl.gui.controllers.slider;
import dev.isxander.yacl.api.Option;
-import dev.isxander.yacl.impl.utils.NumberFormatHelper;
import net.minecraft.text.Text;
import org.apache.commons.lang3.Validate;
@@ -11,7 +10,7 @@ import java.util.function.Function;
* {@link ISliderController} for integers.
*/
public class IntegerSliderController implements ISliderController<Integer> {
- public static final Function<Integer, Text> DEFAULT_FORMATTER = value -> Text.of(NumberFormatHelper.formatSmaller(value));
+ public static final Function<Integer, Text> DEFAULT_FORMATTER = value -> Text.of(String.format("%,d", value));
private final Option<Integer> option;
diff --git a/src/main/java/dev/isxander/yacl/gui/controllers/slider/LongSliderController.java b/src/main/java/dev/isxander/yacl/gui/controllers/slider/LongSliderController.java
index d4c71d1..67b6a0e 100644
--- a/src/main/java/dev/isxander/yacl/gui/controllers/slider/LongSliderController.java
+++ b/src/main/java/dev/isxander/yacl/gui/controllers/slider/LongSliderController.java
@@ -1,7 +1,6 @@
package dev.isxander.yacl.gui.controllers.slider;
import dev.isxander.yacl.api.Option;
-import dev.isxander.yacl.impl.utils.NumberFormatHelper;
import net.minecraft.text.Text;
import org.apache.commons.lang3.Validate;
@@ -11,7 +10,7 @@ import java.util.function.Function;
* {@link ISliderController} for longs.
*/
public class LongSliderController implements ISliderController<Long> {
- public static final Function<Long, Text> DEFAULT_FORMATTER = value -> Text.of(NumberFormatHelper.formatSmaller(value));
+ public static final Function<Long, Text> DEFAULT_FORMATTER = value -> Text.of(String.format("%,d", value));
private final Option<Long> option;