diff --git a/src/content/utils/formatting.ts b/src/content/utils/formatting.ts index 0418a18..d1ba4a3 100644 --- a/src/content/utils/formatting.ts +++ b/src/content/utils/formatting.ts @@ -6,6 +6,8 @@ function toFixed(num: number, fixed: number) { } export function formatPrice(keys: number, metal: number, keyPrice: number, locale: string = 'en') { + if(keys == null) keys = 0 + if(metal == null) metal = 0 const formattedKeys = +(keys + (metal / keyPrice)).toFixed(2) let output: string = ''