We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a013ed commit b17a1c4Copy full SHA for b17a1c4
common/src/main/kotlin/com/lambda/config/settings/NumericSetting.kt
@@ -1,6 +1,8 @@
1
package com.lambda.config.settings
2
3
import com.lambda.config.AbstractSetting
4
+import java.text.NumberFormat
5
+import java.util.*
6
import kotlin.reflect.KProperty
7
8
/**
@@ -27,7 +29,9 @@ abstract class NumericSetting<T>(
27
29
description,
28
30
visibility
31
) where T : Number, T : Comparable<T> {
- override fun toString() = "$value$unit"
32
+ private val formatter = NumberFormat.getNumberInstance(Locale.getDefault())
33
+
34
+ override fun toString() = "${formatter.format(value)}$unit"
35
36
override operator fun setValue(thisRef: Any?, property: KProperty<*>, valueIn: T) {
37
value = valueIn.coerceIn(range)
0 commit comments