mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
fix floating errors
This commit is contained in:
@ -256,7 +256,7 @@ export default {
|
||||
if (this.item.discount_type === 'percentage') {
|
||||
this.item.discount_val = (this.subtotal * newValue) / 100
|
||||
} else {
|
||||
this.item.discount_val = newValue * 100
|
||||
this.item.discount_val = Math.round(newValue * 100)
|
||||
}
|
||||
|
||||
this.item.discount = newValue
|
||||
@ -296,7 +296,7 @@ export default {
|
||||
},
|
||||
set: function (newValue) {
|
||||
if (parseFloat(newValue) > 0) {
|
||||
this.item.price = (newValue * 100).toFixed(2)
|
||||
this.item.price = Math.round(newValue * 100)
|
||||
this.maxDiscount = this.item.price
|
||||
} else {
|
||||
this.item.price = newValue
|
||||
@ -412,7 +412,7 @@ export default {
|
||||
return
|
||||
}
|
||||
|
||||
this.item.discount_val = this.item.discount * 100
|
||||
this.item.discount_val = Math.round(this.item.discount * 100)
|
||||
this.item.discount_type = 'fixed'
|
||||
},
|
||||
selectPercentage() {
|
||||
|
||||
Reference in New Issue
Block a user