User Tools

Site Tools


Number

ECMAScript Number prototype object.

More...

Inherits :

Properties

ECMAScript
NumberMAX_VALUE
NumberMIN_VALUE
NumberNaN
NumberNEGATIVE_INFINITY
NumberPOSITIVE_INFINITY

Constructors

ECMAScript
Number ()
Number ( Number num )

Methods

ECMAScript
StringtoExponential ( Number fractionDigits )
StringtoFixed ( Number fractionDigits )
StringtoLocaleString ()
StringtoPrecision ( Number precision )
StringtoString ( Number radix )
StringtoString ()

Detailed Description

This is the only numeric type in DAZScript. When a script is interacting with classes from the SDK, all the C++ numeric types (int, float, double, etc) are converted to/from this type.

Numbers are not typically constructed, rather they are created by simple assignment.

Example:

var nTemp = 3;
var nTemp2 = 3.14579;

Properties


Number : MAX_VALUE

The largest positive finite value of the Number type; approximately 1.7976931348623157 x 10308.


Number : MIN_VALUE

The smallest positive value of the Number type; approximately 5 x 10-324.


Number : NaN

A number value that is a IEEE 754 “Not-a-Number” value.


Number : NEGATIVE_INFINITY

A number value that is the negative infinite Number value.


Number : POSITIVE_INFINITY

A number value that is the positive infinite Number value.

Constructors


Number()

Default Constructor.


Number( Number num )

Copy Constructor.

Parameter(s):

  • num - The Number to copy.

Methods


String : toExponential( Number fractionDigits )

Parameter(s):

  • fractionDigits - The number of digits following the decimal point after conversion. This must be in the range 0 to 20, if undefined, as many digits as necessary will be displayed.

Return Value:

  • A string representation of the number in exponential notation with one digit before the decimal point, and the given number of digits following the decimal point.

String : toFixed( Number fractionDigits )

Parameter(s):

  • fractionDigits - The number of digits following the decimal point after conversion. This must be in the range 0 to 20, if undefined, 0 is assumed.

Return Value:

  • A string representation of the number in fixed-point notation with the given number of digits following the decimal point.

String : toLocaleString()

Return Value:

  • A string representation of the number, formatted for the current locale.

String : toPrecision( Number precision )

Parameter(s):

  • precision - The number of digits following the decimal point after conversion. This must be in the range 0 to 20, if undefined, the results of toString() are returned.

Return Value:

  • A string representation of the number in either exponential or fixed-point notation with the given number of digits following the decimal point.

String : toString( Number radix )

Parameter(s):

  • radix - The base of the number system to use when converting the number. If the value is 10, or undefined, then the result is the same as toString(). This must be in the range 2 to 36.

Return Value:

  • A string representation of the number.

String : toString()

Return Value:

  • A string representation of the Number.