lint: var to let/const

This commit is contained in:
xenticore
2025-04-24 17:38:02 -04:00
parent d71cfcd0d7
commit df3b40fbdd
11 changed files with 44 additions and 45 deletions

View File

@@ -2,14 +2,14 @@ import { conversion_ref_usd } from '../config';
import { $T } from './localization'
function toFixed(num: number, fixed: number) {
var re = new RegExp('^-?\\d+(?:\.\\d{0,' + (fixed || -1) + '})?');
const re = new RegExp('^-?\\d+(?:\.\\d{0,' + (fixed || -1) + '})?');
return num.toString().match(re)[0];
}
export function formatPrice(keys: number, metal: number, keyPrice: number, locale: string = 'en') {
const formattedKeys = +(keys + (metal / keyPrice)).toFixed(2)
var output: string = ''
let output: string = ''
if(keys > 0) {
output += (formattedKeys == 1.0 ? $T("%@ key") : $T("%@ keys")).replace('%@', formattedKeys.toLocaleString(locale))
} else {