diff --git a/js/components/text_input.js b/js/components/text_input.js index 4c22b6c4..dd20ea09 100644 --- a/js/components/text_input.js +++ b/js/components/text_input.js @@ -103,7 +103,8 @@ export default { this.value = e.target.value.trim() 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)) } }, diff --git a/js/components/totals_box.js b/js/components/totals_box.js index 6bc64c40..8ce5fb49 100644 --- a/js/components/totals_box.js +++ b/js/components/totals_box.js @@ -11,10 +11,16 @@ export default { computed: { formattedObligated: function() { - return formatDollars(this.obligated) + return formatDollars(this._filterNaN(this.obligated)) }, formattedContractAmount: function() { - return formatDollars(this.contractAmount) + return formatDollars(this._filterNaN(this.contractAmount)) + }, + }, + + methods: { + _filterNaN: function(value) { + return Number.isNaN(value) ? 0 : value }, }, } diff --git a/templates/task_orders/edit.html b/templates/task_orders/edit.html index ac855c94..eab683a3 100644 --- a/templates/task_orders/edit.html +++ b/templates/task_orders/edit.html @@ -359,7 +359,12 @@ - +