ts-data-forge
    Preparing search index...

    Variable fromConst

    from: (n: unknown) => number = Number

    Converts an unknown value to a number. Alias for the Number constructor.

    Type Declaration

      • (n: unknown): number
      • Parameters

        • n: unknown

          The value to convert.

        Returns number

        The numeric representation of n.

    const input = '123.45';

    const result = Num.from(input);

    assert(result === 123.45);