ee.Number.toDouble

Casts the input value to a 64-bit float.

UsageReturns
Number.toDouble()Number
ArgumentTypeDetails
this: inputNumberThe input value.

Examples

Code Editor (JavaScript)

// Declare an ee.Number.
var number = ee.Number(100);
print('ee.Number:', number);

// Cast a number to signed 64-bit floating point.
var doubleNumber = number.toDouble();
print('ee.Number cast to double:', doubleNumber);

Python setup

See the Python Environment page for information on the Python API and using geemap for interactive development.

import ee
import geemap.core as geemap

Colab (Python)

# Declare an ee.Number.
number = ee.Number(100)
print('ee.Number:', number.getInfo())

# Cast a number to signed 64-bit floating point.
double_number = number.toDouble()
print('ee.Number cast to double:', double_number.getInfo())