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

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.

    Returns

    True if this instance class contains an array, else false.

    See

    toArrayProxy

    Returns boolean

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

    Returns

    True if this instance class contains an array group, else false.

    See

    toArrayProxyGroup

    Returns boolean

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

    Returns

    True if this instance class contains a boolean, else false

    Returns boolean

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

    Returns

    True if this instance class contains a null value, else false

    Returns boolean

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

    Returns

    True if this instance class contains a DateTime, else false

    Returns boolean

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

    Returns

    True if this class instance contains an error, else false

    Returns boolean

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

    Returns

    True if this instance class contains a null value, else false

    Returns boolean

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

    Returns

    True if this instance class contains a reference, else false

    Returns boolean

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

    Returns

    True if this instance class contains a string, else false

    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.

    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

    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.

    Returns

    True if the value of both instances are equal; otherwise false.

    Parameters

    Returns boolean

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

    Returns

    An array equivalent to the value of this instance.

    See

    ArrayProxy

    Returns ArrayProxy

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

    Returns

    An array group equivalent to the value of this instance.

    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

    Returns

    A boolean floating-point equivalent to the value of this instance

    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

    A boolean floating-point equivalent to the value of this instance

    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

    Returns

    A 8-bit unsigned integer equivalent to the value of this instance

    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

    Returns

    A Unicode character equivalent to the value of this instance

    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

    A Unicode character equivalent to the value of this instance

    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

    Returns

    A DateTime equivalent to the value of this instance

    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

    Returns

    A Decimal equivalent to the value of this instance

    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

    Returns

    A Decimal equivalent to the value of this instance

    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

    Returns

    A double-precision floating-point equivalent to the value of this instance

    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 class instance's value to an int

    Returns

    A signed 32-bit integer value containing the equivalent value of this instance

    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

    Returns

    A signed 32-bit integer value containing the equivalent value of this instance

    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

    Returns

    A 16-bit signed integer floating-point equivalent to the value of this instance

    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

    Returns

    A 32-bit signed integer floating-point equivalent to the value of this instance

    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

    A 32-bit signed integer floating-point equivalent to the value of this instance

    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

    Returns

    A 64-bit signed integer equivalent to the value of this instance

    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

    If this instance contains a object that implements the IExcelCalcReference interface, this method returns the object instance, else an error reference is returned.

    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

    Returns

    A single-precision floating-point equivalent to the value of this instance

    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 representation of 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

    Returns

    A string instance equivalent to the value of this instance

    Parameters

    • provider: IFormatProvider

      An IFormatProvider interface implementation that supplies culture-specific formatting information

    Returns string

  • 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.

    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

    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