import { parseNumber } from '@xenia/i18n/number' /** What a DecimalInput reports for the typed text (6F.2): a number, null (empty) or NaN (not a number). */ export function readDecimal(text, { decimals, allowNegative = false } = {}) { const s = String(text ?? '') if (s.trim() === '') return null const n = parseNumber(s, { decimals, allowNegative }) return n == null ? NaN : n }