Skip to content

Commit

Permalink
issue #140 - js - replace inline currency formatting with call to cus…
Browse files Browse the repository at this point in the history
…tom.js fmt_currency()
  • Loading branch information
jantman committed Oct 30, 2017
1 parent 26339b9 commit 16f7522
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions biweeklybudget/flaskapp/static/js/fuel.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,13 @@ $(document).ready(function() {
{
data: "cost_per_gallon",
"render": function(data, type, row) {
return type === "display" || type === "filter" ?
'$' + data.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") :
data;
return type === "display" || type === "filter" ? fmt_currency(data) : data;
}
},
{
data: "total_cost",
"render": function(data, type, row) {
return type === "display" || type === "filter" ?
'$' + data.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") :
data;
return type === "display" || type === "filter" ? fmt_currency(data) : data;
}
},
{
Expand Down

0 comments on commit 16f7522

Please sign in to comment.