diff --git a/src/dat/controllers/NumberController.js b/src/dat/controllers/NumberController.js index 664191a..3f2c1bb 100644 --- a/src/dat/controllers/NumberController.js +++ b/src/dat/controllers/NumberController.js @@ -68,7 +68,7 @@ class NumberController extends Controller { _v = this.__max; } - if (this.__step !== undefined && _v % this.__step !== 0) { + if (this.__step !== undefined && this.__step !== 0 && _v % this.__step !== 0) { _v = Math.round(_v / this.__step) * this.__step; } diff --git a/src/dat/controllers/NumberControllerBox.js b/src/dat/controllers/NumberControllerBox.js index 462ebf2..c589c90 100644 --- a/src/dat/controllers/NumberControllerBox.js +++ b/src/dat/controllers/NumberControllerBox.js @@ -108,7 +108,7 @@ class NumberControllerBox extends NumberController { } updateDisplay() { - this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision); + this.__input.value = this.__truncationSuspended || this.__step === 0 ? this.getValue() : roundToDecimal(this.getValue(), this.__precision); return super.updateDisplay(); } }