Skip to content
Sheetwrite

Sheetwrite / Documentation

parseCellInput@sheetwrite/core

Coerce raw text input into a CellValue, following spreadsheet input-bar conventions: - blank (after trimming) clears the cell to a null literal; - text longer than one character beginning with = becomes a formula; -…

Coerce raw text input into a CellValue, following spreadsheet input-bar conventions:

  • blank (after trimming) clears the cell to a null literal;
  • text longer than one character beginning with = becomes a formula;
  • in a number column a finite numeric string becomes a number literal;
  • in a date column a recognized date string (parseDateInput) becomes its serial-number literal;
  • in a currency column a currency string (parseCurrencyInput) becomes a plain number literal;
  • anything else is stored verbatim as a text literal (the untrimmed raw).

Shared by the grid's inline editor and any host-built formula bar, so input parsing is identical everywhere instead of re-derived per consumer.

Declaration

function parseCellInput(raw: string, type: CellFormat): CellValue