website: snapshot

This commit is contained in:
nym21
2026-01-24 19:22:03 +01:00
parent 9b706dfaee
commit 7cdf47a9e4
33 changed files with 3031 additions and 2132 deletions

View File

@@ -31,7 +31,7 @@ export const numberToPercentage = new Intl.NumberFormat("en-US", {
export function numberToShortUSFormat(value, digits) {
const absoluteValue = Math.abs(value);
if (isNaN(value)) {
if (isNaN(value) || !isFinite(value)) {
return "";
} else if (absoluteValue < 10) {
return numberToUSNumber(value, Math.min(3, digits || 10));
@@ -41,13 +41,13 @@ export function numberToShortUSFormat(value, digits) {
return numberToUSNumber(value, Math.min(1, digits || 10));
} else if (absoluteValue < 1_000_000) {
return numberToUSNumber(value, 0);
} else if (absoluteValue >= 1_000_000_000_000_000_000_000) {
} else if (absoluteValue >= 1e27) {
return "Inf.";
}
const log = Math.floor(Math.log10(absoluteValue) - 6);
const suffices = ["M", "B", "T", "P", "E", "Z"];
const suffices = ["M", "B", "T", "P", "E", "Z", "Y"];
const letterIndex = Math.floor(log / 3);
const letter = suffices[letterIndex];

View File

@@ -16,7 +16,7 @@ export const Unit = /** @type {const} */ ({
sd: { id: "sd", name: "Std Dev" },
// Relative percentages
pctSupply: { id: "pct-supply", name: "% of Supply" },
pctSupply: { id: "pct-supply", name: "% of circulating Supply" },
pctOwn: { id: "pct-own", name: "% of Own Supply" },
pctMcap: { id: "pct-mcap", name: "% of Market Cap" },
pctRcap: { id: "pct-rcap", name: "% of Realized Cap" },