Update TO Total value to display cents and add in placeholders for classified CLINs

This commit is contained in:
leigh-mil 2019-01-28 10:10:03 -05:00
parent f6a04aea62
commit 5057d2d603

View File

@ -48,22 +48,21 @@ export default {
totalBudget: function() { totalBudget: function() {
return [this.clin_01, this.clin_02, this.clin_03, this.clin_04].reduce( return [this.clin_01, this.clin_02, this.clin_03, this.clin_04].reduce(
function(acc, curr) { function(acc, curr) {
curr = !curr ? 0 : parseInt(curr) curr = !curr ? 0 : parseFloat(curr)
return acc + curr return acc + curr
}, },
0 0
) )
}, },
totalBudgetStr: function() { totalBudgetStr: function() {
return this.formatDollars(this.totalBudget) return this.totalBudget.toLocaleString('us-US', {
style: 'currency',
currency: 'USD',
})
}, },
}, },
methods: { methods: {
formatDollars: function(intValue) {
const mask = createNumberMask({ prefix: '$', allowDecimal: true })
return conformToMask(intValue.toString(), mask).conformedValue
},
showUploadInput: function() { showUploadInput: function() {
this.showUpload = true this.showUpload = true
}, },