Provides methods that manage a composite data type representing a value.

An instance of this class may contain one of several base data types including doubles, singles, integers, booleans, strings, and error values.

The class implements the IConvertible interface providing methods to perform conversions between the basic data types.

Additionally the class provides methods to perform basic arithmetic operations and comparisons between [[ExcelCalcValue]] objects.

Hierarchy

Hierarchy

  • Base
    • ExcelCalcValue

Implements

  • IConvertible
  • IComparable

Constructors

  • Parameters

    • value: any

    Returns ExcelCalcValue

  • Returns ExcelCalcValue

  • Parameters

    • Rest ..._rest: any[]

    Returns ExcelCalcValue

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get isArray(): boolean
  • Returns whether this class instance contains an array value.

    See

    [[toArrayProxy]]

    Returns boolean

  • get isArrayGroup(): boolean
  • Returns whether this class instance contains a group of array values.

    See

    [[toArrayProxyGroup]]

    Returns boolean

  • get isBoolean(): boolean
  • Returns whether this class instance contains a boolean value

    Returns boolean

  • get isDBNull(): boolean
  • Returns whether this class instance contains a DBNull value

    Returns boolean

  • get isDateTime(): boolean
  • Returns whether this class instance contains a DateTime value

    Returns boolean

  • get isError(): boolean
  • Returns whether this class instance contains an error value

    Returns boolean

  • get isNull(): boolean
  • Returns whether this class instance contains a null value

    Returns boolean

  • get isReference(): boolean
  • Returns whether this class instance contains a [[IExcelCalcReference]] value

    Returns boolean

  • get isString(): boolean
  • Returns whether this class instance contains a string value

    Returns boolean

  • get value(): any
  • Return the underlying value

    Returns any

Methods

  • Compares current instance with the passed in [[ExcelCalcValue]] instance. Returns -1, 1 or 0 depending on whether the current instance is less than, greater than or equal to the passed in instance respectively.

    Parameters

    • value: ExcelCalcValue

      The object that this instance should be compared against.

    Returns number

  • Parameters

    • other: any

    Returns boolean

  • Returns number

  • Gets the resolved value of the reference. This method will walk down the reference chain recursively to get the resolved value of the reference that is not just another reference.

    Returns any

  • Gets the resolved value of the reference. This method will walk down the reference chain recursively to get the resolved value of the reference that is not just another reference.

    Parameters

    • willUseValueInCalculations: boolean

      True if the value returned will actually be used in calculations; False if the value is being requested to inspect some aspect of it, such as its type.

    Returns any

  • Indicates if the specified [[ExcelCalcValue]] has the save [[value]] as this instance.

    Parameters

    Returns boolean

  • Returns Base

  • Convert this class instance's value to an [[ArrayProxy]] data type.

    See

    [[ArrayProxy]]

    Returns ArrayProxy

  • Convert this class instance's value to an array group data type.

    See

    [[ArrayProxy]]

    Returns ArrayProxy[]

  • Convert this class instance's value to a boolean data type

    If there is no meaningful conversion, this method will throw an InvalidCastException

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns boolean

  • Convert this class instance's value to a boolean data type

    See

    [[toBoolean]]

    Returns boolean

  • Convert this class instance's value to a byte data type

    If there is no meaningful conversion, this method will throw an InvalidCastException

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns number

  • Convert this class instance's value to a byte data type

    See

    [[toByte]]

    Returns number

  • Convert this class instance's value to a char type

    If there is no meaningful conversion, this method will throw an InvalidCastException

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns string

  • Convert this class instance's value to a char data type

    See

    [[toChar]]

    Returns string

  • Convert this class instance's value to a DateTime data type

    If there is no meaningful conversion, this method will throw an InvalidCastException

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns Date

  • Convert this class instance's value to a DateTime data type

    See

    [[toDateTime]]

    Returns Date

  • Convert this class instance's value to a decimal data type

    If there is no meaningful conversion, this method will throw an InvalidCastException

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns number

  • Convert this class instance's value to a decimal data type

    See

    • [[toDecimal]]
    • [[toDecimal]]

    Returns number

  • Convert this class instance's value to a double data type

    If there is no meaningful conversion, this method will throw an InvalidCastException

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns number

  • Convert this class instance's value to a double data type

    See

    [[toDouble]]

    Returns number

  • Convert this instance's value to an [[ExcelCalcErrorValue]]

    This method returns an [[ExcelCalcErrorValue]] whose error code is set this instance's error code.

    If there this instance does not contain an error, a [[ExcelCalcErrorValue]] containing a default value is returned

    Returns ExcelCalcErrorValue

  • Convert this class instance's value to an int

    Returns number

  • Convert this class instance's value to an int

    If there is no meaningful conversion to an integer this method will throw an InvalidCastException

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns number

  • Convert this class instance's value to a short data type

    If there is no meaningful conversion, this method will throw an InvalidCastException

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns number

  • Convert this class instance's value to a short data type

    See

    [[toInt16]]

    Returns number

  • Convert this class instance's value to a int data type

    If there is no meaningful conversion, this method will throw an InvalidCastException

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns number

  • Convert this class instance's value to a int data type

    See

    [[toInt32]]

    Returns number

  • Convert this class instance's value to a long data type

    If there is no meaningful conversion, this method will throw an InvalidCastException

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns number

  • Convert this class instance's value to a long data type

    See

    [[toInt64]]

    Returns number

  • Convert this instance's value to a [[IExcelCalcReference]].

    The instance value's underlying data type must be reference to return a reference, else an error reference is returned.

    If there is no meaningful conversion to a reference, this method will throw an InvalidCastException

    Returns IExcelCalcReference

  • Convert this class instance's value to a float data type

    If there is no meaningful conversion, this method will throw an InvalidCastException

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns number

  • Convert this class instance's value to a float data type

    See

    [[toSingle]]

    Returns number

  • Returns a string representation of this instance's value.

    Returns string

  • Convert this class instance's value to a string instance data type

    If there is no meaningful conversion, this method will throw an InvalidCastException

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns string

  • Indicates if the value of the specified [[ExcelCalcValue]] is equivalent to the [[value]]

    Parameters

    Returns boolean

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Compares x and y [[ExcelCalcValue]] instances and returns -1 if x is less than y, 1 if x is greater than y and 0 if x and y are equal.

    Parameters

    Returns number

  • Converts a DateTime to Excel's numerical representation of a date.

    When using the 1900 date system in Excel, dates before 3/1/1900 must be corrected, because Excel incorrectly assumes 1900 is a leap year. This overload assumes the 1900 date system is being used as so it corrects the date values.

    Parameters

    • workbook: Workbook
    • dateValue: Date

      The DateTime value to convert to the Microsoft Excel date format.

    Returns number

  • Converts a DateTime to Excel's numerical representation of a date.

    Parameters

    • workbook: Workbook
    • dateValue: Date

      The DateTime value to convert to the Microsoft Excel date format.

    • shouldCorrect1900Dates: boolean

      When using the 1900 date system in Excel, dates before 3/1/1900 must be corrected, because Excel incorrectly assumes 1900 is a leap year. Pass False to disable this correction.

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Converts Excel's numerical representation of a date to a DateTime.

    When using the 1900 date system in Excel, dates before 3/1/1900 must be corrected, because Excel incorrectly assumes 1900 is a leap year. This overload assumes the 1900 date system is being used as so it corrects the date values.

    Parameters

    • workbook: Workbook
    • excelDate: number

      The Microsoft Excel date format which should be converted to a DateTime.

    Returns Date

  • Converts Excel's numerical representation of a date to a DateTime.

    Parameters

    • workbook: Workbook
    • excelDate: number

      The Microsoft Excel date format which should be converted to a DateTime.

    • shouldCorrect1900Dates: boolean

      When using the 1900 date system in Excel, dates before 3/1/1900 must be corrected, because Excel incorrectly assumes 1900 is a leap year. Pass False to disable this correction.

    Returns Date

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns number

  • Parameters

    • a: any
    • b: any

    Returns boolean