Number Class Reference
[ECMAScript/QtScript - Native Objects]

ECMAScript Number prototype object. More...

Inheritance diagram for Number:

Object DzError DzTime List of all members.

Properties

Number MAX_VALUE
Number MIN_VALUE

Constructors

 Number (Number num)
 Number ()

Methods

String toExponential (Number fractionDigits)
String toFixed (Number fractionDigits)
String toLocaleString ()
String toPrecision (Number precision)
String toString ()
String toString (Number radix)

Detailed Description

ECMAScript Number prototype object.

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

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

Example:
    var nTmp = 3;
    var nTmp2 = 3.14579;


Constructor & Destructor Documentation

Number::Number (  ) 

Default Constructor.

Number::Number ( Number  num  ) 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Copy Constructor

Parameters:
num The number to copy


Member Function Documentation

String Number::toExponential ( Number  fractionDigits  ) 

Parameters:
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.
Returns:
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 Number::toFixed ( Number  fractionDigits  ) 

Parameters:
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.
Returns:
A string representation of the number in fixed-point notation with the given number of digits following the decimal point.

String Number::toLocaleString (  ) 

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

Reimplemented from Object.

String Number::toPrecision ( Number  precision  ) 

Parameters:
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.
Returns:
A string representation of the number in either exponential or fixed-point notation with the given number of digits following the decimal point.

String Number::toString (  ) 

Returns:
A string representation of the Number.

Reimplemented from Object.

String Number::toString ( Number  radix  ) 

Parameters:
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.
Returns:
A string representation of the number.


Member Data Documentation

Number Number::MAX_VALUE

The maximum value for floating point values.

Number Number::MIN_VALUE

The minimum value for floating point values.


Generated on Thu Sep 24 12:21:16 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.