Skip to content

Commit

Permalink
[B] Fix parsing project cost estimates with cent (decimal) values
Browse files Browse the repository at this point in the history
  • Loading branch information
timfrazee committed Nov 29, 2021
1 parent 1159397 commit eb25fce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/components/ProjectPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ function setProjectDetails() {
openForUse = 'N/A'
}
let cost = (store.geojson['project_cost_estimate'] || '').replaceAll(/[$,.]/g, '')
cost = parseInt(cost) || ''
let cost = parseInt((store.geojson['project_cost_estimate'] || '').replace(/[$,]/g, ''))
cost = cost.toLocaleString('en-US', { style: 'currency', currency: 'USD', maximumFractionDigits: 0 })
store.details.push(['Phase(s)', phase])
Expand Down

0 comments on commit eb25fce

Please sign in to comment.