rounds implemented + over all improvements
This commit is contained in:
@@ -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));
|
||||
}
|
||||
Reference in New Issue
Block a user