feat: compact icons

This commit is contained in:
tresabhi committed 2026-05-11 16:49:14 -05:00
1 parent 2184c1c703
commit 3a91e082d5
4 files changed
+76 -6

No files matched your search

@@ -0,0 +1,48 @@
// Source - https://stackoverflow.com/a/9083076
// Posted by Rene Pot, modified by community. See post 'Timeline' for change history
// Retrieved 2026-05-11, License - CC BY-SA 4.0
const keys = [
"",
"C",
"CC",
"CCC",
"CD",
"D",
"DC",
"DCC",
"DCCC",
"CM",
"",
"X",
"XX",
"XXX",
"XL",
"L",
"LX",
"LXX",
"LXXX",
"XC",
"",
"I",
"II",
"III",
"IV",
"V",
"VI",
"VII",
"VIII",
"IX",
];
export function romanize(number: number) {
let digits = String(+number).split("");
let roman = "";
let i = 3;
while (i--) {
roman = (keys[+digits.pop()! + i * 10] || "") + roman;
}
return Array(+digits.join("") + 1).join("M") + roman;
}