FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date.

For more details, review the migration guide. Contact support@fauna.com with any questions.

IsDouble

This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics.

Copied!
IsDouble( value )

Description

The IsDouble function returns true only if value is a double-precision, floating-point Number, otherwise it returns false.

Parameters

Parameter Type Definition and Requirements

value

Any

Any value, which is to be tested to determine whether it is a double-precision, floating-point Number or not.

Returns

Returns a Boolean, indicating whether value was a double-precision, floating-point Number or not.

Examples

The following query uses Map to iterate over an array of all of the types of values that can be tested by a type-check function, passing each item into a Lambda function that returns an object, which contains the value and the result of calling IsDouble with that value:

Copied!
Map(
  [
    ['array'],
    true,
    false,
    new Uint8Array([1, 2, 3, 4]),
    [0x1, 0x2, 0x3, 0x4],
    Collection('Letters'),
    Ref('credentials/self'),
    Database('child_db'),
    Date('2019-11-12'),
    Ref(Collection('Letters'), 123),
    10.1,
    Function('double'),
    Index('letters'),
    10,
    Ref(Keys(), '1'),
    Query(Lambda('x', Var('x'))),
    null,
    { x: 10 },
    Role('employees'),
    Match(Index('letters')),
    'ten',
    '10',
    Time('2020-07-06T12:34:56.789Z'),
    Ref(Tokens(), '1'),
  ],
  Lambda('x', {
    value: Var('x'),
    IsDouble: IsDouble(Var('x')),
  })
)
[
  { value: [ 'array' ], IsDouble: false },
  { value: true, IsDouble: false },
  { value: false, IsDouble: false },
  { value: { '0': 1, '1': 2, '2': 3, '3': 4 }, IsDouble: false },
  { value: [ 1, 2, 3, 4 ], IsDouble: false },
  { value: Collection("Letters"), IsDouble: false },
  { value: Ref(Credentials(), "302043979982045696"), IsDouble: false },
  { value: Database("child_db"), IsDouble: false },
  { value: Date("2019-11-12"), IsDouble: false },
  { value: Ref(Collection("Letters"), "123"), IsDouble: false },
  { value: 10.1, IsDouble: true },
  { value: Function("double"), IsDouble: false },
  { value: Index("letters"), IsDouble: false },
  { value: 10, IsDouble: false },
  { value: Ref(Keys(), "1"), IsDouble: false },
  { value: Query(Lambda("x", Var("x"))), IsDouble: false },
  { value: null, IsDouble: false },
  { value: { x: 10 }, IsDouble: false },
  { value: Role("employees"), IsDouble: false },
  { value: Match(Index("letters")), IsDouble: false },
  { value: 'ten', IsDouble: false },
  { value: '10', IsDouble: false },
  { value: Time("2020-07-06T12:34:56.789Z"), IsDouble: false },
  { value: Ref(Tokens(), "1"), IsDouble: false }
]
Query metrics:
  •    bytesIn:   600

  •   bytesOut: 1,583

  • computeOps:     2

  •    readOps:     0

  •   writeOps:     0

  •  readBytes:   373

  • writeBytes:     0

  •  queryTime:  22ms

  •    retries:     0

This query operates on a pre-existing schema, which is not provided here.

Also, the query is executed via a client connection, that uses a secret acquired by calling the Login function (not shown here), so that Ref("credentials/self") returns a valid value.

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!