mirror of
https://github.com/YouHaveTrouble/GuildMaster.git
synced 2026-05-12 14:36:58 +00:00
style buttons and fix up number formatting
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user