Handle NaN in obligated amount input properly
- there is some hackiness to the text input portion
This commit is contained in:
parent
c0da5d482f
commit
d80d8210f9
@ -103,7 +103,8 @@ export default {
|
|||||||
this.value = e.target.value.trim()
|
this.value = e.target.value.trim()
|
||||||
|
|
||||||
if (this.validation === 'dollars') {
|
if (this.validation === 'dollars') {
|
||||||
this.value = formatDollars(this._rawValue(e.target.value))
|
let value = Number.isNaN(e.target.value) ? '0' : e.target.value
|
||||||
|
this.value = formatDollars(this._rawValue(value))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -11,10 +11,16 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
formattedObligated: function() {
|
formattedObligated: function() {
|
||||||
return formatDollars(this.obligated)
|
return formatDollars(this._filterNaN(this.obligated))
|
||||||
},
|
},
|
||||||
formattedContractAmount: function() {
|
formattedContractAmount: function() {
|
||||||
return formatDollars(this.contractAmount)
|
return formatDollars(this._filterNaN(this.contractAmount))
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
_filterNaN: function(value) {
|
||||||
|
return Number.isNaN(value) ? 0 : value
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user