Normalize spaced RNG draw costs
All checks were successful
Deploy Sokko G / deploy (push) Successful in 17s

This commit is contained in:
Shinuwa 2026-09-05 08:58:36 +02:00
parent f8231c748f
commit 25889a23ba
2 changed files with 2 additions and 1 deletions

View file

@ -44,7 +44,7 @@ export function normalizeRateString(value, fallback = RNG_SIMULATOR_DEFAULT_RATE
}
export function normalizeCostString(value, fallback = "") {
const raw = String(value ?? "").trim().replace(",", ".");
const raw = String(value ?? "").trim().replace(/[\s\u00a0]/g, "").replace(",", ".");
if (!raw) return fallback;
if (!/^\d*(?:\.\d+)?$/.test(raw) || raw === ".") return fallback;