2023-03-20 22:48:38 +02:00
|
|
|
import Setting from './setting.js'
|
|
|
|
|
2022-03-07 20:02:53 -05:00
|
|
|
export default {
|
2023-03-20 22:48:38 +02:00
|
|
|
...Setting,
|
2022-03-07 20:02:53 -05:00
|
|
|
props: {
|
2023-03-20 22:48:38 +02:00
|
|
|
...Setting.props,
|
|
|
|
truncate: {
|
|
|
|
type: Number,
|
|
|
|
required: false,
|
|
|
|
default: 1
|
2022-03-07 20:02:53 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2023-03-20 22:48:38 +02:00
|
|
|
...Setting.methods,
|
|
|
|
getValue (e) {
|
|
|
|
if (!this.truncate === 1) {
|
|
|
|
return parseInt(e.target.value)
|
|
|
|
} else if (this.truncate > 1) {
|
|
|
|
return Math.trunc(e.target.value / this.truncate) * this.truncate
|
2023-03-18 20:48:36 +03:00
|
|
|
}
|
2023-03-20 22:48:38 +02:00
|
|
|
return parseFloat(e.target.value)
|
2022-03-07 20:02:53 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|