Skip to content

Commit

Permalink
Merge 83daa17 into 0bcbd8c
Browse files Browse the repository at this point in the history
  • Loading branch information
hubsif authored Apr 16, 2021
2 parents 0bcbd8c + 83daa17 commit 0840f03
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ export default {
},
toStepFixed (value) {
// uses the number of decimals in the step config to round the provided number
if (!this.config.step) return value
const nbDecimals = Number(this.config.step).toString().replace(',', '.').split('.')[1]
const nbDecimals = this.config.step ? Number(this.config.step).toString().replace(',', '.').split('.')[1] : 0
return parseFloat(Number(value).toFixed(nbDecimals))
},
onChange (value) {
const newValue = this.toStepFixed(value)
if (newValue === this.value) return
if (newValue === this.toStepFixed(this.value)) return
if (this.config.variable) {
this.$set(this.context.vars, this.config.variable, value)
} else if (this.config.item) {
Expand Down

0 comments on commit 0840f03

Please sign in to comment.