From 20cdc837af04b8bbac602c98699c7f70cb9ec20b Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 5 Oct 2023 15:14:28 +0200 Subject: [PATCH] Use toFixed instead of toPrecision in Range input toPrecision returns an exponential notation for example for: const x = 100 x.toPrecision(2) --- umap/static/umap/js/umap.forms.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/umap/static/umap/js/umap.forms.js b/umap/static/umap/js/umap.forms.js index 0d983e67..bf9dcdf7 100644 --- a/umap/static/umap/js/umap.forms.js +++ b/umap/static/umap/js/umap.forms.js @@ -854,10 +854,10 @@ L.FormBuilder.Range = L.FormBuilder.Input.extend({ datalist.id = `range-${this.options.label || this.name}` this.input.setAttribute('list', datalist.id) let options = '' + const step = this.options.step || 1, + digits = step < 1 ? 2 : 0 for (let i = this.options.min; i <= this.options.max; i += this.options.step) { - options += `` + options += `` } datalist.innerHTML = options },