View as Markdown

API reference: @salmonui/data-grid/engine/locale

parseNumberfunction

import { parseNumber } from '@salmonui/data-grid/engine/locale';
function parseNumber(text: string, options?: ParseNumberOptions): number | null;

Parses localized number text: '1.234,5' in de-DE is 1234.5. Accepts the locale's digits, group, decimal and minus symbols (and ASCII -, and . when it is not the group symbol), currency and percent signs, and parentheses for accounting negatives. Returns null for empty text and NaN when the text is not a number.