mirror of
https://github.com/seigler/dash-website
synced 2025-07-27 07:16:10 +00:00
JS cleanup: moved format Currency & formatNumber functions together
with network tables JS
This commit is contained in:
parent
fe72accf9b
commit
4ccf18a881
2 changed files with 11 additions and 12 deletions
|
@ -1,12 +0,0 @@
|
|||
/**
|
||||
* Created by cwilliams on 5/4/17.
|
||||
*/
|
||||
function formatNumber (num) {
|
||||
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,")
|
||||
}
|
||||
|
||||
function formatCurrency (num,decimal) {
|
||||
var _decimal;
|
||||
_decimal = typeof decimal !== "undefined" ? decimal : 2;
|
||||
return parseFloat(num).toFixed(_decimal).replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,")
|
||||
}
|
|
@ -113,6 +113,17 @@
|
|||
}
|
||||
|
||||
});
|
||||
|
||||
function formatNumber(num) {
|
||||
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
|
||||
}
|
||||
|
||||
function formatCurrency(num,decimal) {
|
||||
var _decimal;
|
||||
|
||||
_decimal = typeof decimal !== 'undefined' ? decimal : 2;
|
||||
return parseFloat(num).toFixed(_decimal).replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
|
||||
}
|
||||
}(jQuery));
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue