rounds implemented + over all improvements

This commit is contained in:
EmberSpirit
2023-07-10 21:18:05 +02:00
parent 86f4e97f23
commit 9565f494ea
12 changed files with 350 additions and 127 deletions
+14
View File
@@ -1,4 +1,18 @@
export function getImageUrl(url) {
return new URL(url, import.meta.url).href;
}
export function getPercentage(amount, goal) {
console.log("amount", amount);
console.log("goal", goal);
return ((amount / goal) * 100).toFixed(2);
}
export function compactNumber(number) {
return Intl.NumberFormat("en-US", {
notation: "compact",
maximumFractionDigits: 2,
}).format(parseInt(number));
}