942e6 fix scale input decimal value (#444)
* fix password reset bug * fix default integer value on scale input
This commit is contained in:
parent
b0bad02b66
commit
1875faa123
|
|
@ -17,7 +17,7 @@
|
|||
role="button"
|
||||
@click="setScale(i)"
|
||||
>
|
||||
{{ parseFloat(i).toFixed(2) }}
|
||||
{{ formatNumber(i) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -95,6 +95,15 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
formatNumber(num) {
|
||||
if (Math.floor(num) === num) {
|
||||
// return as Integer
|
||||
return num
|
||||
} else {
|
||||
// Fformat to 2 decimal places
|
||||
return parseFloat(num.toFixed(2))
|
||||
}
|
||||
},
|
||||
btnStyle(isSelected) {
|
||||
if (!isSelected) return {}
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -329,8 +329,8 @@ export default {
|
|||
} else if (field.type === 'rating') {
|
||||
inputProperties.numberOfStars = parseInt(field.rating_max_value) ?? 5
|
||||
} else if (field.type === 'scale') {
|
||||
inputProperties.minScale = parseInt(field.scale_min_value) ?? 1
|
||||
inputProperties.maxScale = parseInt(field.scale_max_value) ?? 5
|
||||
inputProperties.minScale = parseFloat(field.scale_min_value) ?? 1
|
||||
inputProperties.maxScale = parseFloat(field.scale_max_value) ?? 5
|
||||
inputProperties.stepScale = parseFloat(field.scale_step_value) ?? 1
|
||||
} else if (field.type === 'slider') {
|
||||
inputProperties.minSlider = parseInt(field.slider_min_value) ?? 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue