Class Double

A class representation of the BSON Double type.

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

  • Create a Double type

    Parameters

    • value: number

      the number we want to represent as a double.

    Returns Double

Properties

value: number

Accessors

  • get _bsontype(): "Double"
  • Returns "Double"

Methods

  • Prints a human-readable string of BSON value information If invoked manually without node.js.inspect function, this will default to a modified JSON.stringify

    Parameters

    • Optional depth: number
    • Optional options: unknown
    • Optional inspect: InspectFn

    Returns string

  • Returns number

  • Parameters

    • Optional radix: number

    Returns string

  • Access the number value.

    Returns number

    returns the wrapped double number.

  • Attempt to create an double type from string.

    This method will throw a BSONError on any string input that is not representable as a IEEE-754 64-bit double. Notably, this method will also throw on the following string formats:

    • Strings in non-decimal and non-exponential formats (binary, hex, or octal digits)
    • Strings with characters other than numeric, floating point, or leading sign characters (Note: 'Infinity', '-Infinity', and 'NaN' input strings are still allowed)
    • Strings with leading and/or trailing whitespace

    Strings with leading zeros, however, are also allowed

    Parameters

    • value: string

      the string we want to represent as a double.

    Returns Double

Generated using TypeDoc