Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

This article covers features introduced in SpiderMonkey 17

Convert a C floating-point number of type double to a JS::Value.

Syntax

// Added in SpiderMonkey 42
JS::Value
JS_NumberValue(double d);

// Obsolete since SpiderMonkey 42
jsval
JS_NumberValue(double d);
Name Type Description
d double The numeric value to convert.

Description

JS_NumberValue converts a C floating-point number of type double to JS::Value, the type of JavaScript values.

The result is an integer JS::Value if d can be stored that way. Otherwise, a new floating-point JS::Value is created.

See Also

Document Tags and Contributors

 Contributors to this page: arai, fscholz, kscarfone, scavenger, tschneidereit, Jorend, Dria, MMondor
 Last updated by: arai,