style buttons and fix up number formatting

This commit is contained in:
2023-04-09 15:35:56 +02:00
parent a185bc2153
commit 61ff80b69f
7 changed files with 57 additions and 17 deletions
+13 -3
View File
@@ -1,10 +1,20 @@
const formatter = new Intl.NumberFormat('en-US', {
const goldFormatter = new Intl.NumberFormat('en-US', {
maximumFractionDigits: 3,
// @ts-ignore - typescript doesn't know about this option for some godforsaken reason
notation: "compact",
useGrouping: true,
});
export default function formatGold(number: number): string {
return formatter.format(number);
const damageFormatter = new Intl.NumberFormat('en-US', {
maximumFractionDigits: 2,
// @ts-ignore - typescript doesn't know about this option for some godforsaken reason
notation: "compact",
});
export function formatGold(number: number): string {
return goldFormatter.format(number);
}
export function formatDamage(number: number): string {
return damageFormatter.format(number);
}