update m issues + e issues
This commit is contained in:
+8
-19
@@ -1,21 +1,17 @@
|
||||
|
||||
export function getImageUrl(url) {
|
||||
return new URL(url, import.meta.url).href;
|
||||
}
|
||||
|
||||
export function getPercentage(amount, goal) {
|
||||
return ((Number(amount) / Number(goal)) * 100).toFixed(2);
|
||||
}
|
||||
|
||||
|
||||
export function compactNumber(number) {
|
||||
return Intl.NumberFormat("en-US", {
|
||||
notation: "compact",
|
||||
maximumFractionDigits: 2,
|
||||
}).format(parseInt(number));
|
||||
// input type bigint
|
||||
export function formatBigIntDivision(nominator, denominator) {
|
||||
const integer = (nominator / denominator).toString();
|
||||
// pick how much digits after point to show
|
||||
const fraction = (nominator % denominator).toString().substring(0,10);
|
||||
// output type string
|
||||
return integer + '.' + fraction;
|
||||
}
|
||||
|
||||
|
||||
export function formatNumber(number) {
|
||||
const options = {
|
||||
style: "decimal",
|
||||
@@ -37,13 +33,6 @@ export function getAddressShortName(address) {
|
||||
}
|
||||
|
||||
|
||||
export function numberWithCommas(x, ) {
|
||||
x = x.toString();
|
||||
var pattern = /(-?\d+)(\d{3})/;
|
||||
while (pattern.test(x)) x = x.replace(pattern, "$1,$2");
|
||||
return x;
|
||||
}
|
||||
|
||||
export function getblocky(address) {
|
||||
var blockiesData = blockies
|
||||
.create({
|
||||
@@ -74,4 +63,4 @@ export function createDebounce() {
|
||||
fnc();
|
||||
}, delayMs || 500);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user