Normalize spaced RNG draw costs
All checks were successful
Deploy Sokko G / deploy (push) Successful in 17s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 17s
This commit is contained in:
parent
f8231c748f
commit
25889a23ba
2 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue