Skip to main content

Module parse

Module parse 

Source
Expand description

Parsing what people type into a cell (and numeric text in formulas).

Recognises numbers with thousands separators, percentages, currency, scientific notation, fractions (1 1/2), dates (3/4/2026, 2026-03-04, 4-Mar-2026, Mar 4, 2026), times (10:30, 10:30:15 PM) and date-times. Locale: en-US.

Structs§

Parsed
A parsed entry: its value and the number format Excel would apply automatically.

Functions§

current_year
The year used for dates typed without one, from the system clock (browser clock on wasm). Falls back to 2026 only when no clock is available.
number_stored_as_text
Text that Excel’s “Number Stored as Text” check flags: it would be a number if typed (signs, thousands separators, currency, percent, exponent, a parenthesised negative). Dates, times and fractions kept as text are not flagged, as in Excel.
parse_input
Interprets typed cell input (not formulas). Text that isn’t a number, date, boolean or error stays text. A leading apostrophe forces text.
parse_number_text
Numeric text as arithmetic coerces it (“1,000”, “50%”, “$3”, “1/2/2020”, “10:00”).
parse_number_text_in
Like parse_number_text, with date text read in the given workbook date system.