dashboard col issue
This commit is contained in:
1 parent
edb0021cc6
commit
8c0e07abb3
4 files changed
+44
-38
No files matched your search
@@ -1,14 +1,19 @@
|
||||
/**
|
||||
* Function takes in a number and formats it to currency
|
||||
* @param {integer}
|
||||
* @returns nuber formatted in currency
|
||||
*/
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const number = document.querySelectorAll(".planGoal");
|
||||
number.forEach(value => {
|
||||
num = parseFloat(value.textContent);
|
||||
if (num >= 999999) {
|
||||
value.textContent = (num /= 1000000).toFixed(2) + "M";
|
||||
console.log(value.textContent);
|
||||
value.textContent = "$" + (num /= 1000000) + "M";
|
||||
} else if (num > 999) {
|
||||
value.textContent = (num /= 1000).toFixed(2) + "K";
|
||||
value.textContent = "$" + (num /= 1000) + "k";
|
||||
} else {
|
||||
return num;
|
||||
return "$" + num;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user