SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface IRuntime

    Describes the host environment the calculation engine is running in.

    Accessible via FormulaContext.getRuntime(), this is primarily used by built-in functions that need to adapt to locale, date system, or platform (e.g. INFO, TEXT, date parsing). Most formula authors will not need it directly.

    interface IRuntime {
        getNow: () => number;
        getRandom: () => number;
        getDescription(): string;
        getLocale(): string;
        getLocaleProfile(): LocaleProfile;
        getLocation(): string;
        getOS(): string;
        getUser(): string | null;
        getVersion(): string;
        isDate1904(): boolean;
        isR1C1(): boolean;
    }
    Index
    getNow: () => number

    Returns the clock this runtime reads, as epoch milliseconds.

    A workbook's own runtime answers the current commit's timestamp, so every cell of a calculation pass agrees and collaborators on that commit agree with each other. A runtime built by a host answers whatever that host supplied — a pinned clock makes NOW and TODAY reproducible, and an unpinned one is the wall clock, which advances between reads.

    getRandom: () => number

    Returns a random number in [0, 1) — one per calculation pass, as getNow is one clock reading per pass.

    This is not a cell's value. Each cell's draw is derived from this one, its position and which draw it is within that cell, so cells that do not depend on each other — which the engine is free to evaluate in any order — get the values their positions earn rather than the values their turn earned.

    Pinning it therefore pins RAND, RANDBETWEEN and RANDARRAY, exactly as pinning getNow pins NOW and TODAY. Left alone it is Math.random, drawn afresh each pass, so volatiles move on every recalculation.

    Values reproduce within one release, not across releases.

    • Returns a description of the runtime environment.

      Returns string

    • Returns the locale of the runtime, e.g. "en-US".

      Returns string

      This is the single authority for regional behavior (number/date formatting and parsing, separators, collation). For a workbook-owned runtime this resolves to the workbook's persisted locale.

    • Returns the resolved regional behavior for IRuntime.getLocale.

      Returns LocaleProfile

      Separators, currency, date patterns, and collation all come from here -- this is the single source of truth, so never derive them independently.

      Takes no argument by design: it answers "what is this runtime's locale". To build a profile for some other tag, use getLocaleProfile(tag) from @sheetxl/sdk.

    • The location of the runtime, e.g. "browser", "node", etc.

      Returns string

    • Returns the OS string of the runtime.

      Returns string

    • Returns the current user or null if no user information is provided.

      Returns string | null

    • The version of the runtime, e.g. "1.0.0".

      Returns string

    • Returns true if the date calculation is using the 1904 date system.

      Returns boolean

    • If the primary address scheme is R1C1, returns true. Otherwise, returns false.

      Returns boolean