From 5057d2d603e1356851b79409409a8e53db7e3576 Mon Sep 17 00:00:00 2001 From: leigh-mil Date: Mon, 28 Jan 2019 10:10:03 -0500 Subject: [PATCH] Update TO Total value to display cents and add in placeholders for classified CLINs --- js/components/forms/funding.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/js/components/forms/funding.js b/js/components/forms/funding.js index dc1f6f46..20b25a2c 100644 --- a/js/components/forms/funding.js +++ b/js/components/forms/funding.js @@ -48,22 +48,21 @@ export default { totalBudget: function() { return [this.clin_01, this.clin_02, this.clin_03, this.clin_04].reduce( function(acc, curr) { - curr = !curr ? 0 : parseInt(curr) + curr = !curr ? 0 : parseFloat(curr) return acc + curr }, 0 ) }, totalBudgetStr: function() { - return this.formatDollars(this.totalBudget) + return this.totalBudget.toLocaleString('us-US', { + style: 'currency', + currency: 'USD', + }) }, }, methods: { - formatDollars: function(intValue) { - const mask = createNumberMask({ prefix: '$', allowDecimal: true }) - return conformToMask(intValue.toString(), mask).conformedValue - }, showUploadInput: function() { this.showUpload = true },