diff --git a/bundles/org.openhab.ui/web/src/components/widgets/system/oh-slider.vue b/bundles/org.openhab.ui/web/src/components/widgets/system/oh-slider.vue index f8a765b92..f58e2e035 100644 --- a/bundles/org.openhab.ui/web/src/components/widgets/system/oh-slider.vue +++ b/bundles/org.openhab.ui/web/src/components/widgets/system/oh-slider.vue @@ -55,8 +55,8 @@ export default { }, toStepFixed (value) { // uses the number of decimals in the step config to round the provided number - const nbDecimals = this.config.step ? Number(this.config.step).toString().replace(',', '.').split('.')[1] : 0 - return parseFloat(Number(value).toFixed(nbDecimals)) + const nbDecimals = this.config.step ? Number(this.config.step).toString().replace(',', '.').split('.')[1]?.length : 0 + return parseFloat(Number(value).toFixed(nbDecimals ?? 0)) }, onChange (newValue) { if (isNaN(this.value)) return